home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / stackey3.zip / STACKEY.DOC < prev    next >
Text File  |  1990-03-25  |  244KB  |  5,563 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.           SSSS    TTTTTT     AA       CCCC   KKK  KK  EEEEEEE  YY  YY   (tm)
  9.          SS  SS   T TT T    AAAA     CC  CC   KK  KK   EE   E  YY  YY
  10.          SSS        TT     AA  AA   CC        KK KK    EE E    YY  YY
  11.           SSS       TT     AA  AA   CC        KKKK     EEEE     YYYY
  12.             SSS     TT     AAAAAA   CC        KK KK    EE E      YY
  13.          SS  SS     TT     AA  AA    CC  CC   KK  KK   EE   E    YY
  14.           SSSS     TTTT    AA  AA     CCCC   KKK  KK  EEEEEEE   YYYY
  15.  
  16.  
  17.  
  18.                                   Version 3.0
  19.  
  20.                                CTRLALT Associates
  21.  
  22.                               _______
  23.                          ____|__     |               (tm)
  24.                       --|       |    |-------------------
  25.                         |   ____|__  |  Association of
  26.                         |  |       |_|  Shareware
  27.                         |__|   o   |    Professionals
  28.                       -----|   |   |---------------------
  29.                            |___|___|    MEMBER
  30.  
  31.  
  32.  
  33.  
  34.       TABLE OF CONTENTS
  35.  
  36.       Chapter I:INTRODUCTION....................................3
  37.          I.1 What It Does.......................................3
  38.          I.2 For the new user...................................4
  39.          I.3..Shareware Considerations..........................5
  40.          I.4 New in Version 3.0................................10
  41.          I.5 New in Version 2.0................................11
  42.          I.6 Files in the STACKEY package......................12
  43.          I.7 Loading and Using STACKEY.........................13
  44.          I.8 HELP!!............................................15
  45.          I.9 Errorlevel........................................15
  46.       Chapter II:PLACING KEYSTROKES IN THE BUFFER..............17
  47.          II.1 Stacking text....................................17
  48.          II.2 Two-character Codes..............................17
  49.          II.3 Status Toggles...................................21
  50.          II.4 Prompt metastrings...............................21
  51.          II.5 Decimal and Hex Codes............................22
  52.          II.6 Invoking special programs and keystrokes.........23
  53.          II.7 Simulating depression of shift keys..............25
  54.          II.8 Stacking real time beeps.........................25
  55.          II.9 Popup messages...................................26
  56.          II.10 Sending to standard output......................26
  57.          Appendix 1 to Chapter II. Two character codes.........27
  58.          Appendix 2 to Chapter II...SENDing to STDOUT..........30
  59.       Chapter III:COMMANDS TO THE RESIDENT PORTION.............36
  60.          III.1 Overview........................................36
  61.          III.2 Repeats.........................................36
  62.          III.3 Delays..........................................37
  63.          III.4 Scanning........................................38
  64.          III.5 The phony keystroke.............................40
  65.          III.6 Hotkeys.........................................40
  66.          III.7 Pauses for keystrokes...........................42
  67.          III.8 Multiple STACKEY commands.......................42
  68.          III.9 Patient, impatient and smart processing.........43
  69.          III.10 Flushing and Quitting..........................45
  70.          III.11 Enlarging the Buffer...........................46
  71.          III.12 The SKRES program..............................47
  72.          III.13 Test mode......................................48
  73.          III.14 Continue mode..................................48
  74.          III.15 Pushing, popping and querying the flags........49
  75.       Chapter IV:SETTING COLORS................................50
  76.          IV.1 Color Basics: Introduction.......................50
  77.          IV.2 Color Basics: Graphics modes.....................50
  78.          IV.3 Color Basics: CGA color choices..................51
  79.          IV.4 Setting colors on the CGA........................52
  80.          IV.5 Color Basics: EGA color slots and palettes.......54
  81.          IV.6 Color Basics: EGA color labelling................54
  82.          IV.7 Color Basics: EGA borders........................56
  83.          IV.8 Color Basics: EGA hardware considerations........56
  84.          IV.9 Setting colors on the EGA or VGA.................57
  85.          IV.10 Setting permanent colors on the EGA/VGA.........59
  86.          IV.11 Controlling the blinking bit....................60
  87.  
  88.  
  89.  
  90.  
  91.       Chapter V:UTILITIES MODE.................................62
  92.          V.1 Overview of Utilities Mode........................62
  93.          V.2 Waits.............................................64
  94.          V.3 Switching Monitors and Ports......................67
  95.          V.4 Turning off PrintScreen...........................68
  96.          V.5 Mode, Lines and Cursor Control....................68
  97.          V.6 Beeps.............................................70
  98.          V.7 Screen dumps......................................70
  99.          V.8 Rebooting.........................................71
  100.          V.9 Lock Toggles......................................72
  101.          V.10 The Halt Command.................................72
  102.          V.11 Pause for input..................................73
  103.       Chapter VI:ADVANCED TOPICS...............................74
  104.          VI.1 Keyboard basics: interupts.......................74
  105.          VI.2 Keyboard basics: The buffer and BIOS data area...76
  106.          VI.3 Keyboard basics: Int 9 processing................77
  107.          VI.4 Keyboard basics: int 16/DOS service 8............79
  108.          VI.5 Keyboard Basics: How other programs work.........81
  109.          VI.6 Keyboard basics: How STACKEY works (or doesn't)..81
  110.          VI.7 Inline: Syntax...................................84
  111.          VI.8 External: Syntax.................................85
  112.          VI.9 Inline examples..................................86
  113.          VI.10 STACKEY's API...................................88
  114.       Chapter VII:ASSOCIATED PROGRAMS..........................90
  115.          VII.1 FILEKEY.........................................90
  116.          VII.2 EGAPAL and VGAPAL...............................91
  117.          VII.3 Demonstration BATch files.......................93
  118.       Chapter VIII:MISCELLANY..................................95
  119.          VIII.1 Usage notes....................................95
  120.          VIII.2 Also by the same authors.......................97
  121.          Appendix to Chapter VIII..............................99
  122.  
  123.  
  124.  
  125.                              Chapter I:INTRODUCTION
  126.  
  127.       FIRST A WORD FROM OUR SPONSOR: THIS IS NOT FREE SOFTWARE.  IF YOU
  128.       CONTINUE TO USE IT AFTER AN INITIAL 30 DAY TRIAL PERIOD, YOU MUST
  129.       REGISTER; PLEASE SEE SECTION I.3.  THANK YOU.
  130.  
  131.  
  132.       I.1 What It Does
  133.  
  134.             STACKEY, a utility from the makers of CTRLALT, will
  135.       automatically place keystrokes in your keyboard buffer.  It is
  136.       intended for use in connection with BATch files.  Here is a typical
  137.       example of a BATch file "lot.bat" for use with 1-2-3 using STACKEY:
  138.             stackey W18 CR"/FR%1.wk1" CR
  139.             123
  140.       Entering "lot mysht" at the DOS command line starts the BATch
  141.       file with mysht as %1.  STACKEY has the command line passed to it
  142.       by the BATch processor with %1 already replaced by mysht.  Thus
  143.       STACKEY places in the keyboard buffer the text: "/FRmysht.wk1"
  144.       followed by a carriage return.  The initial W18 tells STACKEY to
  145.       pause about 1 second to allow 123 to load.  If it weren't there 123
  146.       would happily remove the keystrokes from the buffer before allowing
  147.       any input.  These characters wait in the buffer until a program
  148.       requests keyboard input.  The BATch file then loads 123 which
  149.       requests input and gets it from STACKEY.  /FR calls up a dialog to
  150.       retrieve a worksheet and %1.wk1 followed by a CR loads that
  151.       worksheet.  The CR after the W18 will banish the opening logo
  152.       screen in those versions with an opening logo.
  153.  
  154.             And this example hardly uses the power of STACKEY: you can
  155.       stack any function key or legal Alt-key combination; you can even
  156.       stack today's date or the current directory name.  You can stack
  157.       commands to turn the Num Lock state on and off.  You can stack
  158.       commands to set colors on the CGA and remap colors on the EGA or VGA.
  159.       You can stack a PrtSc.  You can stack commands to call up SIDEKICK,
  160.       SIDEKICK PLUS or any other program that pops up on pairs of shifts.
  161.       You can invoke CTRLALT PLUS, CAROUSEL or DESQVIEW.  STACKEY has
  162.       numerous methods for controlling the flow of a STACKEY "script".  You
  163.       can put delays in or have STACKEY delay its playback until a given
  164.       message appears on the screen or you can have script playback pause
  165.       until you hit a key.  You can pause playback and later restart it with
  166.       appropriate hotkeys and even flush STACKEY's buffer that way.
  167.  
  168.             STACKEY also has a utilities mode allowing you to use it to
  169.       replace lots of little utilities that switch monitors or ports,
  170.       restore or change the cursor or even reboot your machine. STACKEY
  171.       comes with a second program BATUTIL, described in a separate manual
  172.  
  173.  
  174.     Chapter I:INTRODUCTION                                      Page 3
  175.  
  176.  
  177.  
  178.  
  179.                   Documentation for STACKEY, Version 3.0
  180.  
  181.  
  182.       with which you can manipulate your environment or get input in BATch
  183.       files.
  184.  
  185.             Finally STACKEY has a special mode of interest to programmers
  186.       giving you access STACKEY's insides, allowing you place inline code
  187.       in the middle of a STACKEY script.
  188.  
  189.             And STACKEY does its magic with only about 1.3K of resident
  190.       code (with the default buffer size).
  191.  
  192.             For a quick summary of what STACKEY can do, you can call up
  193.       help any time you are at the DOS command line with the command
  194.             stackey ?
  195.       (see the HELP!! Section I.8 below) or you can consult the quick
  196.       summary at the end of the documentation.
  197.  
  198.  
  199.       I.2 For The New User
  200.  
  201.             STACKEY is a powerful package which has many features that
  202.       you won't want to use too often.  For that reason the manual is
  203.       long but many parts can be skipped when you first start using the
  204.       program.  For the basic stacking commands, you'll want to read the
  205.       first three sections of Chapter II after reading the next section.
  206.       After that, you can be off and running.  If you want to use
  207.       utilities mode, you'll need to read Chapter V and if you want to set
  208.       colors with STACKEY, you'll need Chapter IV.  This latter chapter
  209.       is long because of the EGA color tutorial which is included.  If
  210.       you have a CGA, you should only read the first four sections.  If
  211.       you've been confused when hearing about int 16 and int 9, you might
  212.       look at the keyboard basics parts of Chapter VI.
  213.  
  214.             While STACKEY has numerous options to change the way it
  215.       works, typically set and changed with /../ instructions on the
  216.       command line, we have set the defaults to be the most reasonable.
  217.       Thus, you need not worry about these questions unless you find
  218.       yourself in a situation where you wished STACKEY worked differently
  219.       in order to properly interface some particular application program.
  220.       You may be able to tell it to act in an appropriate way.
  221.  
  222.             A summary of the STACKEY commands can be obtained by typing
  223.               stackey ?
  224.  
  225.  
  226.  
  227.  
  228.     Chapter I:INTRODUCTION                                      Page 4
  229.  
  230.  
  231.  
  232.  
  233.                   Documentation for STACKEY, Version 3.0
  234.  
  235.  
  236.             If you obtained a registered version of STACKEY/BATUTIL
  237.       directly from Support Group, you'll find directions for installing
  238.       the program in the readme.com program.  The files on diskette are
  239.       in self compressed archives prepared with the Lharc program.  We
  240.       thank Yoshi for writing this program and allowing its use.  If you
  241.       are a less advanced user, you'll want to run the batch file
  242.       INSTHARD.BAT to install BATUTIL and STACKEY on your hard disk or if
  243.       you have only two floppies, use INSTFLOP.BAT.  The hard disk
  244.       automated installation places the programs in the directories
  245.       C:\stackey and C:\batutil.  It requires roughly 700K of free disk
  246.       space including the doc files which you won't need if you are
  247.       registered and have the printed docs.  INSTFLOP requires that you
  248.       have four blank but formatted floppy diskettes handy.  Both
  249.       programs only run from the A: drive.
  250.  
  251.             More sophisticated users may wish to do the installation by
  252.       hand to control the directories where the programs live (they can
  253.       be anywhere although you may want them on your path).  Go to the
  254.       directory you want STACKEY, place the distribution diskette in
  255.       drive A and run
  256.             A:skexe
  257.       and
  258.             A:skdoc
  259.       Then go to the directory you want BATUTIL and run
  260.             A:buexe
  261.       and
  262.             A:budoc
  263.       With floppies each command should be issued with a fresh floppy in
  264.       drive B.
  265.  
  266.             If you got your trial version from a BBS or disk vendor,
  267.       there directions for installation may be different.  Basically you
  268.       want to unpack any archives.  You can then run the programs
  269.       directly.
  270.  
  271.  
  272.       I.3  Shareware Considerations
  273.  
  274.             The STACKEY package consisting of STACKEY, FILEKEY and
  275.       EGA/VGAPAL were developed by Barry Simon and Richard Wilson and is
  276.       copyright, 1986-90 by us.  Unlike versions 1.x and 2.x which were
  277.       copyrighted but free, this version is shareware.  You have a 30 day
  278.       trial period from the time that you first use the program to see if
  279.       it meets your needs.  If you continue to use it after that time you
  280.  
  281.  
  282.     Chapter I:INTRODUCTION                                      Page 5
  283.  
  284.  
  285.  
  286.  
  287.                   Documentation for STACKEY, Version 3.0
  288.  
  289.  
  290.       are required to pay a registration fee not as a contribution but
  291.       because you are getting use out of our program.  Shareware is
  292.       dedicated to the idea that users are best served by a chance to
  293.       fully try out something as complex and individualistic as software
  294.       before they buy it and that authors are served by an ethic that
  295.       encourages wide copying for trial runs.  But in order for the
  296.       system to work you need to respect the trust that we show in you
  297.       and register if you continue to use our program.   With the release
  298.       of this shareware version, we will no longer support earlier
  299.       versions of STACKEY.
  300.  
  301.             Registration fees are as follows:
  302.               License to STACKEY & BATUTIL with printed docs        $39
  303.               Consultant's License                                 $200
  304.       All registrations will get you the printed documentation and the
  305.       latest version on disk.  The printed documentation is essentially
  306.       identical to the documentation on disk.
  307.  
  308.             You may register by phoning or writing (9AM-5PM Eastern time)
  309.             Support Group, Inc
  310.             Lake Technology Park
  311.             PO Box 130
  312.             McHenry, MD 21541
  313.             1(800)872-4768    (1-800-USA-GROUP)
  314.             1(301)387-4500
  315.             FAX 1(301)387-7322
  316.  
  317.       Visa, Mastercard, Discover and American Express are accepted.
  318.  
  319.             Registration gives you the right to use any version of STACKEY
  320.       with a major version number of 3.  If there is a version 4, an
  321.       update fee may be required.  In addition to the thirty day trial
  322.       period, you may return the disks (and printed documentation) for a
  323.       full refund if you are not totally satisfied for a period of
  324.       90 days after initial registration.  You have the choice of one of
  325.       two license terms: "use like a book" OR a single user license.  The
  326.       former allows you to place copies of this software on as many
  327.       machines as you wish so long as there is NO CHANCE that more than
  328.       one copy of STACKEY will be loaded into any of the machine's
  329.       memories at one time.  The latter allows you to place copies on all
  330.       machines for which YOU are the principal user even if there is a
  331.       chance that OCCASIONALLY more than one copy is in use (for example,
  332.       if you use STACKEY on a office machine while a family member might
  333.       OCCASIONALLY use a copy on a home machine at the same time).
  334.  
  335.  
  336.     Chapter I:INTRODUCTION                                      Page 6
  337.  
  338.  
  339.  
  340.  
  341.                   Documentation for STACKEY, Version 3.0
  342.  
  343.  
  344.       This 800 number is for orders only.  Registed users may obtain
  345.       support by writing to
  346.             CTRLALT Associates
  347.             Suite 133
  348.             260 South Lake Ave.
  349.             Pasadena, CA 91101
  350.       or you may reach us via MCIMAIL (CTRLALT Associates) or on Compuserve.
  351.       Simon has a Compuserve number [76004,1664].  CTRLALT Associates has its
  352.       own Compuserve support area: section 12 of PCVENDOR FORUM A.  After
  353.       logging onto Compuserve, GO PCVEN will take you to this forum.  In
  354.       addition to asking questions, you will be able to download the latest
  355.       version and various sample files, tips, etc.  You can aslo reach
  356.       us on the IBMSYS forum and on the UTILITIES forum of PCMAGNET.
  357.       For general discussions of shareware issues, you can GO SHAREWARE
  358.       and leave messages in Section 8.  You can also reach Simon via
  359.       internet by using the Internet/Compuserve connection.  Send
  360.       messages on internet to
  361.             76004.1664@compuserve.com
  362.       CTRLALT Associates is happy to offer a free Compuserve signup kit
  363.       including a $15 credit.  Details are provided with your registration
  364.       kit.  This offer is dependent on its continued availability from
  365.       the Compuserve Information service.
  366.  
  367.             We're glad to hear comments, suggestions about enhancements,
  368.       as well as complaints, incompatibilities and bugs.  Suggestions for
  369.       enhancements would be especially welcome.  For example, we added
  370.       utilities mode in going from version 1.0 to version 2.0 in response
  371.       to a request to allow a reboot command.  You can find the version
  372.       of STACKEY by using the DOS command "type STACKEY.COM" or by
  373.       passing a /?/ to STACKEY on the command line.
  374.  
  375.             Consultant's license: Consultant's may want to use STACKEY
  376.       and BATUTIL to customize a client's system. For this purpose we
  377.       offer a special consultant's license which allows you to personally
  378.       place copies of BATUTIL and/or STACKEY on any client's machine
  379.       without additional fees so long as no help or documentation is
  380.       included.  We refer here to the documentation and help files that
  381.       we supply.  If you are interested in some kind of bundling of
  382.       STACKEY and/or BATUTIL with a product, please write to CTRLALT
  383.       Associates at our address or send MCImail or Compuserve easyplex to
  384.       us. Consultant's licenses are limited to people placing the
  385.       software on machines owned by companies for which they are not
  386.       employees, that is, it is not intended for sitewide licenses.
  387.  
  388.  
  389.  
  390.     Chapter I:INTRODUCTION                                      Page 7
  391.  
  392.  
  393.  
  394.  
  395.                   Documentation for STACKEY, Version 3.0
  396.  
  397.  
  398.             Volume discounts start at 5 copies and sitewide licenses at
  399.       500 copies according to the following:
  400.                   5-10 copies:    15% discount
  401.                   11-20 copies:   20% discount
  402.                   21-500 copies:  25% discount
  403.                   sitewide license to 500 copies:   $ 8,000
  404.                   sitewide license to 1000 copies:  $10,000
  405.                   unlimited sitewide license:       $25,000
  406.       Volume discounts are shipped with one set of (two - STACKEY and
  407.       BATUTIL) manuals for each two program licenses.  Sitewide licenses
  408.       comes with 100 copies of the manuals with additional manual sets
  409.       available for a nominal fee.
  410.  
  411.             Foreign users are asked, if possible, to pay via credit card.
  412.       Foreign registrants will be billed for first class airmail postage.
  413.  
  414.             If you like the program, please give it to your friends, place
  415.       it on bulletin boards and otherwise spread it around.  We explicitly
  416.       allow TRIAL use of it privately and in a commercial environment.
  417.       You may give it away, but you may not charge for it or include it
  418.       with commercial software without our permission.  An exception is
  419.       made for user groups and shareware software distributors who are
  420.       approved shareware distributors of the Association of Shareware
  421.       Professionals, an organization to which both Wilson and Simon belong.
  422.       Those interested in contacting ASP to become approved distributors
  423.       should write for an application to
  424.             Association of Shareware Professionals
  425.             Executive Director
  426.             PO Box 5786
  427.             Bellevue,WA 98006
  428.       Vendors may only distribute the full BATUTIL/STACKEY package which
  429.       archived fits on a single diskette; see vendor doc.
  430.  
  431.             This program is produced by a member of the Association of
  432.       Shareware Professionals (ASP).  ASP wants to make sure that the
  433.       shareware principle works for you. If you are unable to resolve a
  434.       shareware-related problem with an ASP member by contacting the
  435.       member directly, ASP may be able to help. The ASP Ombudsman can
  436.       help you resolve a dispute or problem with an ASP member, but does
  437.       not provide technical support for members' products. Please write
  438.       to the ASP Ombudsman at P.O. Box 5786, Bellevue, WA 98006 or send a
  439.       Compuserve message via easyplex to ASP Ombudsman 70007,3536.
  440.  
  441.  
  442.  
  443.  
  444.     Chapter I:INTRODUCTION                                      Page 8
  445.  
  446.  
  447.  
  448.  
  449.                   Documentation for STACKEY, Version 3.0
  450.  
  451.  
  452.             STACKEY is warranted for no particular purpose.  While we
  453.       have tried to make the program bug free, no software can be
  454.       guaranteed to be free of bugs.  Due to the complex nature of
  455.       computer software CTRLALT ASSOCIATES does not warrant that the
  456.       licensed Software is completely error-free, will operate without
  457.       interruption, or is compatible with all equipment and software
  458.       configurations.  Repair, replacement or refund, at the option of
  459.       the CTRLALT ASSOCIATES, is the exclusive remedy of the customer, in
  460.       the event of a defect.  By using this program, you accept it AS IS
  461.       and agree that we will NOT be held responsible for any damages
  462.       including but not limited to consequential damages or loss of data.
  463.       This includes damages caused by problems of which CTRLALT
  464.       Associates is already aware.  We will attempt to correct any bug
  465.       which is pointed out to us.  Registered users are entitled to use
  466.       bug fixes while still numbered 3.xx.  We do not intend to support
  467.       Version 3.xx once a Version 4.xx is available and you may need to
  468.       pay an upgrade fee to a new version if there are any bug fixes made
  469.       once Version 4.xx is available.  You may ask for a full refund of
  470.       your registration for a period up to 90 days after you register but
  471.       only if you return the program package sent registered users and
  472.       agree to destroy any copies of BATUTIL and STACKEY in your
  473.       possession and cease using the programs.  While we have attempted
  474.       to make this documentation as clear as possible, we cannot
  475.       guarantee that there will not be misunderstanding or user error.
  476.  
  477.             We specifically exclude any warranties, EXPRESS OR IMPLIED,
  478.       including the IMPLIED WARRANTIES OF MERCHANTABILITY or FITNESS FOR
  479.       A PARTICULAR PURPOSE.   SOME STATES DO NOT ALLOW THE IMPLIED
  480.       WARRANTIES TO BE EXCLUDED.  CONSULT A LAWYER TO SEE WHETHER OR NOT
  481.       THE ABOVE EXCLUSIONS APPLY TO YOU IN YOUR STATE.
  482.  
  483.             This documentation, the programs and source code for the
  484.       associated programs STACKEY, FILEKEY, EGAPAL, VGAPAL and the
  485.       demonstration BATch files COLOR, SEECOLOR, CGACOLOR, and SOUNDS are
  486.       copyright by Barry Simon and Richard M. Wilson, 1986 - 1990, all
  487.       rights reserved.
  488.  
  489.             The following may be trademarked names: Turbo Pascal, Reflex
  490.       and Sidekick by Borland International, Newfont by Mark Horvatich,
  491.       CED and PCED by the Cove Software Group, Fansi Console by Hersey
  492.       Microcomputing, Software Carousel by Softlogic, IBM by IBM,
  493.       Ultravision by Personics, Codeview by Microsoft, Quikbuf by Intel,
  494.       Frieze by Zsoft, List by Vern Buerg, Move'em and 386Max by
  495.       Qualitas, Qemm, Qram and DesqView by Quarterdeck, Pizazz Plus by
  496.  
  497.  
  498.     Chapter I:INTRODUCTION                                      Page 9
  499.  
  500.  
  501.  
  502.  
  503.                   Documentation for STACKEY, Version 3.0
  504.  
  505.  
  506.       Applications Technology, Tesseract by Innovative Data Concepts,
  507.       123 by Lotus Development Corporation and Bradford by Concom.
  508.       BATUTIL, STACKEY and CTRLALT are trademarks of Ctrlalt Associates.
  509.  
  510.  
  511.       I.4 New in Version 3.0
  512.  
  513.             If you have been using version 2.0 of STACKEY here are some
  514.       of the new features in this version:
  515.             -  You can now pause playback (while allowing other programs
  516.                 to run in the foreground) until a stated character string
  517.                 appears at a given place on the screen or until it
  518.                 appears at the current cursor position.  To remind you
  519.                 that this scan mode is on, the cursor will blink.  As an
  520.                 alternative, you can scan "silently", that is with this
  521.                 visual cue not implemented.
  522.             -  You can simulate depressing any set of shift keys for a user
  523.                 specifiable number of clock ticks.  This will allow
  524.                 popping up of SIDEKICK, SIDEKICK PLUS, PRIMETIME and many
  525.                 other programs.
  526.             -  You can load the resident part of STACKEY in high memory
  527.                 with 386max or Qemm.
  528.             -  You can invoke CTRLALT PLUS.
  529.             -  You can swap Carousel partitions or simulate the hitting
  530.                 of the Desq key in DesqView.  You can also invoke any TSR
  531.                 which conforms to the Tesseract standard.
  532.             -  You can send STACKEY text strings and control codes to
  533.                 standard output rather than the keyboard replacing the
  534.                 need for a separate SEND program
  535.             -  STACKEY now has four hot keys which allow you to talk to
  536.                 the resident part from within other programs.  One will
  537.                 stop playback and flush the buffer, one will pause
  538.                 playback until the third restart playback hotkey is hit,
  539.                 and one will cancel active scans. You can also pause a
  540.                 script to await the restart playback key.  These keys can
  541.                 be changed from the DOS command line.
  542.             -  You can insert beeps and popup messages into STACKEY
  543.                 scripts.
  544.             -  For people who understand assembly language programming
  545.                 you can insert inline code or external files into a
  546.                 STACKEY script.  This will allow others to provide custom
  547.                 routines to you even if you don't understand assembly
  548.                 code.
  549.             -  STACKEY now comes with a stand alone program BATUTIL which
  550.  
  551.  
  552.     Chapter I:INTRODUCTION                                     Page 10
  553.  
  554.  
  555.  
  556.  
  557.                   Documentation for STACKEY, Version 3.0
  558.  
  559.  
  560.                 gives you considerable control over batch files and over
  561.                 the DOS environment.
  562.             -  The EGA color support added in STACKEY 2.0 has been extended
  563.                 to VGAs and to users of Ultravision.
  564.             -  More informative error messages in response to syntax errors.
  565.  
  566.  
  567.       I.5 New in Version 2.0
  568.  
  569.             If you have been using version 1.0 of STACKEY, here are some
  570.       of the new features of version 2.0 carried over to version 3.0:
  571.             - Color support on the CGA including borders, background in
  572.                medium resolution graphics and palette change
  573.             - Color support on the EGA both temporary color changes and
  574.                changes to permanent palettes when used in conjunction
  575.                with a program that moves the permanent palettes to RAM
  576.             - A separate program that moves the permanent palettes to RAM
  577.             - A utilities mode that allows you to switch monitors, ports,
  578.                cursor size, mode and 25 vs 43/50 lines.  Variable beeps and
  579.                a command to wait from .05 seconds to 30 minutes before
  580.                resuming
  581.             - Possibility to dump the screen to a file or printer at some
  582.                point in the middle of a BATch file
  583.             - The equivalent of DOS' pause but without a message (so you
  584.                can supply your own) with the possibility of having the
  585.                <Enter> key alone accepted or of having the BATch file
  586.                aborted under a Y/N choice.  This is now done better with
  587.                BATUTIL but is kept in version 3.0 for compatibility with
  588.                version 2.0 scripts.
  589.             - Optional modes that control what happens when STACKEY finds
  590.                a syntax error
  591.             - Modes to handle programs that flush the buffer after every
  592.                keystroke
  593.  
  594.             With the exception of two commands, version 3.0 is upward
  595.       compatible with STACKEY, Version 1.0.  The /xxxx/ has been replaced
  596.       by /Bxxxx/ and /+xxxx/ by /Rxxxx/ (B for buffer and R for reload).
  597.       Version 3.0 is fully upward compatible with Version 2.0.
  598.  
  599.             STACKEY Vers. 3.x ignore the existence of STACKEY Vers. 1.0
  600.       and 2.x.  Thus if you try to load 3.x with the any earlier version
  601.       resident, both will be loaded.  And each will only talk to the
  602.       appropriate version.   However, if you try to run one version of
  603.       STACKEY 3.x with another resident, you will get the message:
  604.  
  605.  
  606.     Chapter I:INTRODUCTION                                     Page 11
  607.  
  608.  
  609.  
  610.  
  611.                   Documentation for STACKEY, Version 3.0
  612.  
  613.  
  614.             STACKEY: Version number doesn't match resident part.
  615.                                 Re-install (Y/N)?
  616.  
  617.  
  618.       I.6 Files in the STACKEY package
  619.  
  620.       There are six executable programs
  621.             STACKEY.COM    -    The basic program
  622.             SKRES.COM      -    Version for special loading; see Section
  623.                                   III.11
  624.             FILEKEY.COM    -    Program to send input to STACKEY's stack
  625.                                   from a file
  626.             EGAPAL.COM     -    Program to allow STACKEY to control
  627.                                   permanent palettes on the EGA
  628.             VGAPAL.COM     -    Program to allow STACKEY to control
  629.                                   permanent palettes on the VGA
  630.             BOXES.COM      -    Small program for the demonstration BATch
  631.                                   file CGACOLOR.BAT
  632.  
  633.       four demonstration BATch files
  634.             CGACOLOR.BAT   -    Demonstrates STACKEY's color commands for
  635.                                   the CGA
  636.             COLOR.BAT      -    Demonstrates STACKEY's color commands for
  637.                                   the EGA  by displaying all 64 colors;
  638.                                   use a parameter to indicate the time
  639.                                   between color changes in half second
  640.                                   units; e.g. "color 3" would give 1.5
  641.                                   second change times.
  642.             SEECOLOR.BAT   -    Allows you to see any color or colors
  643.                                   supported on the EGA by typing in their
  644.                                   numbers or color patterns; e.g.
  645.                                   "seecolor 14" or "seecolor RrGgB" or
  646.                                   "seecolor 23 42"
  647.             SOUNDS.BAT     -    Illustrates the {BEEP} command
  648.  
  649.       ten files demonstrating the STACKEY external interface:
  650.             FLASH.BIN      -    External code to flash the screen
  651.             FLASH.ASM      -    Source for flash.bin
  652.             FLUSH.BIN      -    External code to reenable the keyboard
  653.                                   and flush the buffer
  654.             FLUSH.ASM      -    Source for flush.bin
  655.             MAKEMESS.ASM   -    Shell for making popup yes no messages
  656.             SAMPLE.MSG     -    A sample external made with MAKEMESS
  657.             GAVOTTE.BIN    -    High class music external file
  658.  
  659.  
  660.     Chapter I:INTRODUCTION                                     Page 12
  661.  
  662.  
  663.  
  664.  
  665.                   Documentation for STACKEY, Version 3.0
  666.  
  667.  
  668.             MONTEV.BIN     -    Another high class music external file
  669.             POP.BIN        -    A less high class music external file
  670.             MUSIC.ASM      -    Source for music files
  671.       (See Section VI.9 for more on these samples).
  672.  
  673.       and the help files
  674.             STACKEY.HLP    -    Basic Help file
  675.  
  676.             In addition, there are the files associated with BATUTIL
  677.       discussed in the BATUTIL documentation.
  678.  
  679.             While these programs are the package and may be distributed as
  680.       such, the original disks from CTRLALT Associates come with the files
  681.       in compressed format.  The file README.COM on the distribution
  682.       disk will explain how to install the programs.  You cannot just
  683.       use the copy command.  If you got them from another source, that
  684.       source may have used another packing method.
  685.  
  686.  
  687.       I.7 Loading and Using STACKEY
  688.  
  689.             The first time that STACKEY is invoked, it loads a small
  690.       resident portion which becomes permanently resident taking almost
  691.       exactly one kilobyte of RAM for code plus whatever buffer size you
  692.       choose.  By default the buffer size is 128 'keystrokes' or 256
  693.       bytes.  This can be changed; see Chapter III - indeed many of the
  694.       new features takes 3-10 keystrokes of buffer space and some
  695.       considerable more so you may want a larger buffer.  It displays
  696.       the message:
  697.             Resident part of STACKEY now in place.
  698.       and proceeds to read its command line.  At later times, STACKEY
  699.       will find itself in memory and only read its command line.  If you
  700.       are using a hardware or software protocol that allows loading in
  701.       high memory (MAXIT board, 386max or QEMM), you'll want to use SKRES
  702.       rather than STACKEY as you will if you want a buffer with over
  703.       10000 keystrokes, see Section III.11.
  704.  
  705.             STACKEY will place keystrokes in its stack according to the
  706.       rules of syntax described below.  If there is a syntax error, it
  707.       will exit with no keyboard stacking and give an error message.  For
  708.       example, saying
  709.             stackey "hello "CRthere
  710.  
  711.  
  712.  
  713.  
  714.     Chapter I:INTRODUCTION                                     Page 13
  715.  
  716.  
  717.  
  718.  
  719.                   Documentation for STACKEY, Version 3.0
  720.  
  721.  
  722.       will result in the error message
  723.             Oops!  There is an error on the STACKEY command line.
  724.              "hello "CRthere
  725.                        ^
  726.            Unrecognized command.
  727.       The arrow (shown as a caret here) will point to the first place on
  728.       the line that STACKEY was unable to interpret.  The command
  729.       line to send hello on one line and there on the next should have
  730.       said
  731.             stackey "hello "CR"there"
  732.  
  733.             The arrow will indicate other errors; for example, if you ask
  734.       STACKEY to swap printer ports but you only have one printer port,
  735.       STACKEY will exit with
  736.             Oops!  There is an error on the STACKEY command line.
  737.              {PRN}
  738.                 ^
  739.             Hardware or software environment does not appear to support
  740.                   this command.
  741.       The syntax is fine but there is an error none the less.  Similarly,
  742.       if you try to swap Carousel partitions but STACKEY finds that
  743.       Carousel isn't loaded, you will get an error message.
  744.  
  745.             The command line is parsed into parts consisting of text
  746.       between quotes, two character special codes, hex and decimal input,
  747.       delays and special commands.  Some of the two character special
  748.       commands allow an integer for the second "character" which may be
  749.       more than one numeral.  The special commands include EGA/VGA color
  750.       settings between square [] brackets and utilities commands inside
  751.       pointed braces {}.  Certain of the new features like SCan and SHift
  752.       take parameter inside ().  If only a utility is called up and the
  753.       final } is left off, the resident part of STACKEY will not load.
  754.       Spaces between the parts are optional so that
  755.             stackey F1"hello"^r@E
  756.       is the same as
  757.             stackey F1 "hello" ^r @E
  758.       or even
  759.             stackey F1               "hello" ^r@E
  760.       but
  761.             stackey F 1"hello"^r@E
  762.       which splits the two character code F1 will result in an error message.
  763.  
  764.  
  765.  
  766.  
  767.  
  768.     Chapter I:INTRODUCTION                                     Page 14
  769.  
  770.  
  771.  
  772.  
  773.                   Documentation for STACKEY, Version 3.0
  774.  
  775.  
  776.       I.8 .HELP!!
  777.  
  778.             Seventeen screens of help are available if you type in
  779.             stackey ?
  780.       To get help, the file STACKEY.HLP distributed with STACKEY must be
  781.       available either in the default directory or in your path.  This
  782.       STACKEY.HLP file is different from the file of the same name
  783.       distributed with STACKEY 2.0.  If that old STACKEY.HLP is found,
  784.       STACKEY will exit with the error message:
  785.             The file STACKEY.HLP has wrong format or version number.
  786.       The first help screen is a table of contents and the last one an
  787.       index.  You can search by hitting S or goto a given page with Goto.
  788.       The help is a useful summary but not really a replacement for
  789.       reading the manual!
  790.  
  791.             On a true monochrome monitor like the original MDA or
  792.       Hercules card, STACKEY ? will show up in the proper two color
  793.       attributes.  But on a color adapter with monochrome screen (for
  794.       example, most laptops), the "colors" may make the help invisible or
  795.       ugly.  On such a screen call for help with
  796.             STACKEY ?m
  797.  
  798.             When you exit the help, a screen appears reminding you to
  799.       register.  You can suppress this screen by placing
  800.             BU$=I paid
  801.       in your environment.  Obviously, having told you the secret, you
  802.       can do it even if you haven't paid - let your conscience be your
  803.       guide.
  804.  
  805.  
  806.       I.9 ERRORLEVEL
  807.  
  808.             If STACKEY can interpret its command line and does not find
  809.       the buffer full, it exits with an error level of 0.  If there is an
  810.       error in the command line, the errorlevel is set to 1, if there is
  811.       a buffer overflow, the errorlevel is 2 and if there is any kind of
  812.       DOS file error whether due to an invalid path or an open drive door
  813.       in the {dumpf} utility, the errorlevel is set to 3.  You can test the
  814.       errorlevel in BATch files with the "if errorlevel.." DOS command.
  815.       All error messages are directed to standard output so you can
  816.       redirect them to NUL and suppress them if you will handle errors
  817.       with errorlevel.  An example of this can be found in the
  818.       demonstration BATch file COLOR.BAT.  If you enter an illegal
  819.       parameter value, say "color a", the BATch file responds by
  820.  
  821.  
  822.     Chapter I:INTRODUCTION                                     Page 15
  823.  
  824.  
  825.  
  826.  
  827.                   Documentation for STACKEY, Version 3.0
  828.  
  829.  
  830.       suppressing an error message from STACKEY and giving you one
  831.       appropriate to the BATch file.   How STACKEY responds to an error
  832.       is controlled by the /t/ and /c/ commands discussed in Chapter III.
  833.       By default STACKEY will flush its and BIOS's buffers when there is
  834.       an error but the BATch file will continue.
  835.  
  836.             If STACKEY finds that the version number of the resident part
  837.       does not agree with the version number of the file that you have
  838.       invoked, it will exit with an errorlevel of 4.
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.     Chapter I:INTRODUCTION                                     Page 16
  877.  
  878.  
  879.  
  880.                   Chapter II:PLACING KEYSTROKES IN THE BUFFER
  881.  
  882.       II.1  Stacking text
  883.  
  884.             Most often, you will want to stack ordinary alphanumeric
  885.       data, that is the white letters in the center of the keyboard
  886.       including the numbers, punctuation, braces, etc.  You do this by
  887.       placing the text within quotes on the command line as in
  888.             stackey "hello there"
  889.       or
  890.             stackey 'hello there'
  891.       Either single or double quotes can be used.  Once a quote occurs on
  892.       the line, every letter counts until a matching quote OF THE SAME
  893.       TYPE occurs so to place
  894.             "Hi!", he said
  895.       in the stack, you can use
  896.             stackey '"Hi!", he said'
  897.       You cannot stack both types of quotes within one string but you
  898.       can stack strings with both types of quotes by using more than one
  899.       string.  For example, to stack
  900.             "I can't come", he said
  901.       use
  902.             stackey '"I can' "'" 't come", he said'
  903.       Later, we will describe the command codes SQ and DQ for placing
  904.       quotes.  You could also use:
  905.             stackey DQ"I can't come"DQ", he said"
  906.       to stack the above string.
  907.  
  908.             While you will mainly stack ASCII characters corresponding to
  909.       the white keys between quotes, you can also stack an ASCII
  910.       character such as the graphics characters.  STACKEY will simulate
  911.       the hitting of the A key if you use stackey "A"; it will simulate
  912.       entering an ASCII code above 128 as if it were entered from the
  913.       Alt-numeric keypad.
  914.  
  915.  
  916.       II.2 Two-character Codes
  917.  
  918.             Many keys on the keyboard do not correspond to any ASCII
  919.       character.  For these and also for a few ASCII characters, STACKEY
  920.       recognizes special two character codes.  The first of these can be
  921.       a special symbol such as ^, @ or #.  Because some programs like CED
  922.       give special meaning to some of these codes, we have given them
  923.       alternatives.  That is, as the FIRST character in these codes:
  924.             ~ means the same as ^
  925.             ( means the same as @
  926.             ) means the same as #
  927.             * means the same as $
  928.  
  929.  
  930.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 17
  931.  
  932.  
  933.  
  934.  
  935.                   Documentation for STACKEY, Version 3.0
  936.  
  937.  
  938.       This replacement is only effective for the first character, so that
  939.       you cannot replace ^^ by ~~ but only by ~^.  If you need to stack a
  940.       control-^ and ^ has a special meaning, you will have to use another
  941.       method like hex codes.  These alternatives are not applicable in
  942.       the color setting commands (i.e. you cannot use [)3 1=4] in place
  943.       of [#3 1=4]).
  944.  
  945.             You stack function keys using one of F,S,C,A (for function,
  946.       shifted function, control function and alt function) followed by a
  947.       single digit; 0 stands for 10 and on an enhanced keyboard, - stands
  948.       for 11 and = for 12 (note the - and = keys are on the numeric row
  949.       in the eleventh and twelfth place).  Thus Ctrl-F10 is stacked with
  950.       C0 and
  951.             stackey C2 A3 S5 F0 A-
  952.       would stack the sequence Ctrl-F2, Alt-F3, Shift-F5, F10, Alt-F11.  You
  953.       may use either upper case or lower case for the key letter f,s,c,a.  Do
  954.       not confuse ^1 (for Control-end) and C1 or @1 (for alt-1) and A1.
  955.  
  956.             You can stack the numbers on the numeric keypad with N0,...,
  957.       N9, the numeric decimal point (shift del) with N. and the grey +, -
  958.       and * with N+, N- and N*.
  959.  
  960.             The BIOS also makes codes for certain Alt key combinations:
  961.       legal possibilities are alt- followed by any letter or number (top
  962.       row numbers) or the following special symbols: - =.  These can be
  963.       stacked by preceding the key with @, e.g.
  964.             stackey @a @2 @-
  965.       will stack Alt-A followed by Alt-2 followed by Alt-minus.  It does
  966.       not matter if you use upper or lower case letters or if you use @!
  967.       rather than @1 or @_ rather than @-.
  968.  
  969.             Similarly, available control combinations are the letters A-Z,
  970.       [,\,],^,_,`,@ left arrow, right arrow, home, end, pgup, pgdn, prtsc.
  971.       These are entered using the ^ (or ~) as the first key.  ^A through
  972.       ^Z will enter those control codes as will ^[, ^\,....  The six
  973.       keys, on the numeric keypad corresponding to ^Home, etc. can be
  974.       entered with the corresponding numbers 1,3,4,6,7,9.  Thus
  975.             stackey ^z ^Z ^[ ^6
  976.       will stack two control z's, an escape and then ctrl-right arrow
  977.       (but the "escape" here is entered as if you depressed the control
  978.       key and then struck [; to enter an escape as if you hit the escape
  979.       key, use $e or ES as described below).  For the letters, ^ may be
  980.       followed by an upper or lower case letter.  For the remaining
  981.       combinations, only one possibility is allowed.  For example, do not
  982.  
  983.  
  984.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 18
  985.  
  986.  
  987.  
  988.  
  989.                   Documentation for STACKEY, Version 3.0
  990.  
  991.  
  992.       confuse ^^ and ^6.
  993.  
  994.             In the next chapter, we will discuss the PH two character code
  995.       which stacks a PHony keystroke and the WR two character code which
  996.       stacks a "Wait for Request".
  997.  
  998.             Next, there are two character mnemonics for special key
  999.       combinations as follows:
  1000.                 LA              Left Arrow
  1001.                 RA              Right Arrow
  1002.                 UA              Up Arrow
  1003.                 DA              Down Arrow
  1004.                 PU              Page Up
  1005.                 PD              Page Down
  1006.                 HM              Home
  1007.                 EN              End
  1008.                 IN              Insert
  1009.                 DE              Delete
  1010.                 G+         Grey plus  ("+" will send the top row +; also N+)
  1011.                 G-         Grey minus ("-" will send the top row -; also N-)
  1012.                 G*         Grey star  ("*" will send the top row *; also N*)
  1013.                 CP              Control PrtSc
  1014.                 PS              PrtSc
  1015.                 TA or TB        Tab
  1016.                 ST or BT        Shift Tab (=Back Tab)
  1017.                 ES              Escape     (also $e)
  1018.                 BS              Backspace  (also $h)
  1019.                 SP              Space bar  (also " ")
  1020.                 CR              Enter (carriage return)
  1021.                 LF              Ctrl-Enter (line feed)
  1022.                 FF              form feed (^L) (NEW in vers 3.0)
  1023.                 DQ              The double quote "
  1024.                 SQ              The single quote '
  1025.                 CB              Ctrl-Backspace (NEW in vers 3.0)
  1026.       These codes can be entered in upper or lower case.  It is a little
  1027.       known fact that Ctrl-Backspace is a legitimate keystroke that even
  1028.       enters a valid code: ASCII 127 which is .
  1029.  
  1030.             PS for PrtSc will simulate the pressing of the Shift-PrtSc
  1031.       key.  If some other program, e.g. PIZAZZ PLUS has taken over that
  1032.       key, it will be called up with PS.
  1033.  
  1034.             ^! will simulate the Ctrl-Break key; for techies, it places an
  1035.       ASCII 0 word in the keyboard buffer and then calls int 1BH.
  1036.  
  1037.  
  1038.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 19
  1039.  
  1040.  
  1041.  
  1042.  
  1043.                   Documentation for STACKEY, Version 3.0
  1044.  
  1045.  
  1046.             STACKEY provides support for combinations understood by the
  1047.       enhanced keyboard or by the BIOS that comes with machines supporting
  1048.       the enhanced keyboard.  First, the following Alt-key combinations are
  1049.       allowed: Alt-[ Alt-] Alt-; Alt-' Alt-` Alt-\ Alt-, Alt-. Alt-/.
  1050.       These are entered with the combinations A[ A] A; A' A` A\ A, A. A/.
  1051.       In addition we have the following codes for the enhanced keyboard:
  1052.             Alt-Bksp           AB
  1053.             Alt-Enter          AC
  1054.             Alt-Esc            AE
  1055.             Alt-Tab            AT
  1056.             Ctrl-Tab           CT
  1057.       The alt-keypad cursor keys (i.e. everything but the 5 key but
  1058.       including Ins and Del) are allowed keys with a enhanced keyboard.
  1059.       You enter them with K followed by the number, e.g. Alt-Left is K4
  1060.       and Alt-Del is K, The center key (unshifted 5 when numlock isn't
  1061.       on) is K5.  In addition we have:
  1062.             Alt-Numpad K /       K/
  1063.             Alt-Numpad K *       K*
  1064.             Alt-Numpad K -       K-
  1065.             Alt-Numpad K +       K+
  1066.             Alt-Numpad K Enter   KC
  1067.             Ctrl- K /            ^/
  1068.             Ctrl- K *            ^*
  1069.             Ctrl- K -            ^-
  1070.             Ctrl- K +            ^+
  1071.             Ctrl- K Up [8]       ^8
  1072.             Ctrl- K 5  [5]       ^5
  1073.             Ctrl- K Dn [2]       ^2
  1074.             Ctrl- K Ins[0]       ^0
  1075.             Ctrl- K Del[.]       ^.
  1076.             Grey Enter           GE or GC
  1077.       While most programs do not distinguish them, the enhanced BIOS will
  1078.       distinguish the cursor pad keys and the numeric pad keys. The cursor
  1079.       pad keys are given by
  1080.             Cursor pad End     G1
  1081.             Cursor pad DA      G2
  1082.             Cursor pad PD      G3
  1083.             Cursor pad LA      G4
  1084.             Cursor pad RA      G6
  1085.             Cursor pad Hm      G7
  1086.             Cursor pad UA      G8
  1087.             Cursor pad PU      G9
  1088.             Cursor pad Ins     G0
  1089.             Cursor pad Del     G.
  1090.  
  1091.  
  1092.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 20
  1093.  
  1094.  
  1095.  
  1096.  
  1097.                   Documentation for STACKEY, Version 3.0
  1098.  
  1099.  
  1100.       The logic behind the codes is a little stretched.  The G is because the
  1101.       keys are grey; the 1,2,3 correspond to the numbers the keys correspond
  1102.       to on the keypad (not the cursor pad!).
  1103.  
  1104.             An appendix to this chapter summarizes all the two character
  1105.       codes in alphabetic order.
  1106.  
  1107.       II.3 Status Toggles
  1108.  
  1109.             You can turn NumLock, etc. on or off from the STACKEY command
  1110.       line.  The syntax is
  1111.                 +N              Turn NumLock on
  1112.                 -N              Turn NumLock off
  1113.                 +C              Turn CapsLock on
  1114.                 -C              Turn CapsLock off
  1115.                 +S              Turn ScrollLock on
  1116.                 -S              Turn ScrollLock off
  1117.                 +I              Turn BIOS insert mode indicator on
  1118.                 -I              Turn BIOS insert mode indicator off
  1119.  
  1120.             Strictly speaking, the discussion of status toggles does not
  1121.       belong in this chapter since they are handled in real time.  That
  1122.       is rather than placing a command in the resident buffer, a command
  1123.       like +N is interpreted and acted on by the non-resident part of
  1124.       STACKEY as soon as it reaches the interpretation of that part of
  1125.       the command line.  In this sense, the lock toggles are like
  1126.       utilities and, indeed, they are included also in utilities mode.
  1127.       They continue to be available in two code form for compatibility
  1128.       with earlier versions of STACKEY.  BATUTIL will let you read the
  1129.       state of the lock keys from a batch file; see Section IV.9 of the
  1130.       BATUTIL documentation.
  1131.  
  1132.  
  1133.       II.4 Prompt metastrings
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 21
  1147.  
  1148.  
  1149.  
  1150.  
  1151.                   Documentation for STACKEY, Version 3.0
  1152.  
  1153.  
  1154.             STACKEY supports the full set of metastrings allowed in the
  1155.       DOS PROMPT command as well as the added strings supported by the
  1156.       program SEND.COM of Howard Rumsey and Barry Simon.  Specifically:
  1157.                 $$              The character "$"
  1158.                 $t              The time in HH:MM:SS.hh format
  1159.                 $d              The date in DAY MM-DD-YYYY format
  1160.                                    e.g. Tue 9-30-1986
  1161.                 $p              The current path in full, e.g. C:\BIN\FOO
  1162.                 $v              The current DOS version
  1163.                 $n              The current default drive
  1164.                 $g              The character ">"
  1165.                 $l              The character "<"
  1166.                 $b              The character "|"
  1167.                 $q              The character "="
  1168.                 $h              The backspace
  1169.                 $e              The ESCape
  1170.                 $_              CR/LF (i.e. <Enter> followed by Ctrl-<Enter>)
  1171.                 $P              same as $p in the root dir and as $p\ elsewhere
  1172.                 $T              time in HHMM format
  1173.                 $M              month in MM format, e.g. 09
  1174.                 $D              day in DD format, eg 03
  1175.                 $Y              year in YY format, eg 86 in 1986 and 01 in 2001
  1176.                 $W              day of the week in English, e.g. Sunday
  1177.                 $E              the date in English, e.g. February 18, 1988
  1178.                 $H              hour from 00 to 23
  1179.                 $m              minute from 00 to 59
  1180.       There is a difference between upper case and lower case after the
  1181.       $.  $W, $E, $M and $m are new with this version.
  1182.       Because of STACKEY's send mode (see Section II.10), you need no
  1183.       longer use the SEND program but can use STACKEY instead. That is, you
  1184.       can use STACKEY to send these codes to standard output.
  1185.  
  1186.  
  1187.       II.5 Decimal and Hex Codes
  1188.  
  1189.             This section deals with advanced features not needed by most
  1190.       users.  See Chapter VI for a tutorial on keyboard basics used in
  1191.       this section.
  1192.  
  1193.             You may enter various ASCII key combinations from the
  1194.       keyboard by pressing Alt (or by pressing Alt-Left Shift) and
  1195.       tapping one to three digits on the keypad and then releasing Alt.
  1196.       To stack keystrokes as if entered in this way use \ followed by a
  1197.       decimal number, so
  1198.  
  1199.  
  1200.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 22
  1201.  
  1202.  
  1203.  
  1204.  
  1205.                   Documentation for STACKEY, Version 3.0
  1206.  
  1207.  
  1208.             stackey \104\101\108\108\111
  1209.       at the DOS command line will cause "hello" to appear on your
  1210.       screen.
  1211.  
  1212.             Keystrokes are stored in the buffer as a set of two hex
  1213.       bytes: a scan code and an ASCII code.  You can enter such a
  1214.       combination by typing an X followed by four hex digits.  The first
  1215.       two are the scan code and the second pair the ASCII code.  For
  1216.       example
  1217.             stackey X2368 X1265 X266C X266C X186F
  1218.       at the DOS command line will cause "hello" to appear on your
  1219.       screen.  The hex digits a-f and the letter x can be either upper or
  1220.       lower case.
  1221.  
  1222.             Because they are used internally by STACKEY, the scan codes
  1223.       E0 through FF (which are not legal anyway) are allowed but take
  1224.       the place of two keystrokes in STACKEY's buffer.  STACKEY will
  1225.       place in the keyboard buffer whatever combination you tell it to
  1226.       even if it is an illegal combination.  DOS will only pay attention
  1227.       to the ASCII half of such combination as will many programs.  Some
  1228.       keyboard macro programs will allow such possibilities.  For
  1229.       example, KEYWORKS associates Ctrl-Up Arrow (a keystroke not
  1230.       supported by an old style BIOS) with 8448.  Stackey X8448 will call
  1231.       up the KEYWORKS macro assigned to Ctrl-Up if one is defined.   Some
  1232.       combinations are filtered out by the so-called enhanced keyboard.
  1233.  
  1234.  
  1235.       II.6 Invoking special programs and keystrokes
  1236.  
  1237.             Most TSRs will not pop up by responding to strokes in the
  1238.       keyboard buffer and, as a result, STACKEY cannot invoke them by its
  1239.       usual method.  However, when we have special information about a
  1240.       program, we can provide a special routine for that program in
  1241.       particular.  We'll discuss those commands, all new in Version 3.0
  1242.       here.  For programs that popup on depression of several shift keys,
  1243.       like SIDEKICK, we can simulate depressing shift keys as discussed
  1244.       in the next section.  Here are the special invocation routines:
  1245.  
  1246.             CTRLALT PLUS:  CA will invoke the main menu of CTRLALT PLUS so,
  1247.       for example
  1248.               stackey CA"MAP"
  1249.       will print the entire screen even if you are in 43 or 50 line mode.
  1250.       If CTRLALT PLUS is not loaded, you'll get an error message from
  1251.       STACKEY.
  1252.  
  1253.  
  1254.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 23
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                   Documentation for STACKEY, Version 3.0
  1260.  
  1261.  
  1262.             DESQVIEW: Quarterdeck provides two methods for macros to
  1263.       simulate the Desq key which work on different keyboards or BIOS.  We
  1264.       have assigned them to D1 and D2.  So for example
  1265.               stackey D1"Z"
  1266.       would zoom the current window to full screen.  The combination DL is
  1267.       the same as the Desqview learn key.  Finally {boot=d} as a utility will
  1268.       invoke a Desqview specific reboot command.
  1269.  
  1270.             CAROUSEL: You can tell Carousel to switch to partition n with
  1271.       Qn where n=1,2,...,9,0 (0 is for partition 10); with Carousel 3.0
  1272.       or later, you can also use Q- and Q= to switch to partitions 11 and
  1273.       12..  Thus you might have a sequence of BATch files that
  1274.       successively loads partitions 1,2,....  If you want to load program
  1275.       "foobar" in partition 6, issue the string "hello" followed by F1 to
  1276.       the program and then switch to partition 7, you'd end the batch
  1277.       file for partition 6 with
  1278.                stackey "hello" F1 W36 Q7
  1279.                foobar
  1280.       The wait command W36 which is discussed in the next chapter (and
  1281.       pauses for 2 seconds) gives the program time to react to the
  1282.       keystrokes before the swap.  You may need to adjust the W command
  1283.       for particular applications.
  1284.  
  1285.             TESSERACT PROGRAMS: Tesseract is a library of TSR routines
  1286.       provided by Innovative Data Concepts as a shareware product.  If a
  1287.       TSR is written with these routines, you can invoke it with the TE
  1288.       command:
  1289.             stackey te(idstring)
  1290.       will call up the tesseract TSR with the given idstring name.  You'll
  1291.       need to consult the documentation that came with your program to
  1292.       find the required id string but here is an example.  Suppose you
  1293.       have SWAPSP and want to dial the third entry in your phone book
  1294.       under M.  Use
  1295.          stackey TE(SWAPSP15)"PM"DNDNCR
  1296.       The idstring must be exactly eight characters in length.  For
  1297.       Tesseract programs that allow multiple hotkeys, each hotkey has an
  1298.       a number.  Te(idstring) will call the program with hotkey 0.  For
  1299.       other hotkeys, place a /NN after the idstring.  Thus, for example
  1300.             stackey te(idstring/23)
  1301.       would invoke the program in question via hotkey 23.
  1302.  
  1303.             CLONE SPEEDUP/SLOWDOWN:  Many clones have two speeds adjusted
  1304.       with ^@G+/-.  You can simulate this with
  1305.                stackey Z+
  1306.  
  1307.  
  1308.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 24
  1309.  
  1310.  
  1311.  
  1312.  
  1313.                   Documentation for STACKEY, Version 3.0
  1314.  
  1315.  
  1316.       to speedup and
  1317.                stackey Z-
  1318.       for slowdown.  This will not work with all clones.
  1319.  
  1320.             You might object to some of these additions to STACKEY by
  1321.       saying that you don't use CAROUSEL and object to resident memory
  1322.       being taken by the CAROUSEL command.  In fact, most of these
  1323.       commands take NO additional memory - they use the inline feature
  1324.       discussed in Section VI.7.
  1325.  
  1326.  
  1327.       II.7 Simulating depression of shift keys
  1328.  
  1329.             Some popups come up when you depress a pair of shift keys.
  1330.       You can simulate the depression of any subset of the four shifts
  1331.       with the command SH which takes two parameters in the form
  1332.             SH(XXX,YY)
  1333.       where XXX is some subset of the letter C,A,L,R for the Control, Alt,
  1334.       Left shift and Right shift respectively and YY is a number from 1 to
  1335.       65,535.  This command simulates depressing the shift keys in
  1336.       question for YY clock ticks.  You'll need to experiment with the
  1337.       value of YY depending on the program.  We added that parameter
  1338.       because different programs seem to require different values.  For
  1339.       example, with a default SIDEKICK Ctrl+Alt, you can invoke the
  1340.       SIDEKICK main menu from within a STACKEY script with
  1341.             stackey SH(CA,1)
  1342.       but invocation of SIDEKICK PLUS requires
  1343.             stackey SH(CA,n)
  1344.       where n is at least 7 or 8 while PRIMETIME (with say C+L as hot
  1345.       key) seems to require
  1346.             stackey SH(CL,10)
  1347.       You'll need to adjust the shift mask to whatever combination you've
  1348.       chosen for your application.  For example, if you've changed the
  1349.       SIDEKICK popup to C+L use SH(CL,1) rather than SH(CA,1).
  1350.  
  1351.  
  1352.       II.8 Stacking real time beeps
  1353.  
  1354.             STACKEY scripts can include real time BIOS beeps with the special
  1355.       two key code BE.  Beeps are especially useful combined with loops and
  1356.       waits and with jumps (see Section III.2).
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 25
  1363.  
  1364.  
  1365.  
  1366.  
  1367.                   Documentation for STACKEY, Version 3.0
  1368.  
  1369.  
  1370.       II.9 Popup messages
  1371.  
  1372.             STACKEY scripts can include popup messages that are displayed and
  1373.       take over the machine until the user hits a key.  There are two versions
  1374.       depending on whether you want the key hit passed to the underlying
  1375.       application.
  1376.             STACKEY MP(hi there)
  1377.       will display the message "hi there" in a box and pass the keystroke on
  1378.       while
  1379.             STACKEY ME(hi there)
  1380.       would eat the keystroke.  These messages are implemented as inline code
  1381.       to avoid having to permanently use resident memory but as a result they
  1382.       take a lot of buffer space.  A message takes 156 bytes plus 7 times the
  1383.       length of the message. The default buffer has only 256 bytes so that
  1384.       long messages will require you to load STACKEY with the command (see
  1385.       Sections III.11 and III.12) to take a larger buffer.
  1386.  
  1387.  
  1388.       II.10 Sending to standard output
  1389.  
  1390.             STACKEY places keystrokes in the keyboard buffer.  However,
  1391.       you can tell STACKEY to instead send the interpreted material to
  1392.       standard output.  You could then redirect this output to a file or
  1393.       the printer.  Thus STACKEY provides a replacement for the SEND
  1394.       program of Rumsey and Simon.  With their permission, a modified
  1395.       version of the documentation for SEND is provided as an appendix to
  1396.       this chapter.
  1397.  
  1398.             To send output to the standard output, include the special
  1399.       symbol underscore in the STACKEY command line so that
  1400.             STACKEY _"hello"$_
  1401.       will have the same effect as
  1402.             echo hello
  1403.       Following _ the ONLY allowed codes are:
  1404.             character strings in quotes
  1405.             control codes of the form ^x with x=a,...,z,[,\,],^ or _ (but
  1406.                not ^1, or ^@ etc)
  1407.             prompt metastrings in extended form as discussed above
  1408.             upper ASCII codes in the form \xxx
  1409.             the following two character codes: TA, TB, ES, BS, SP, CR, LF,
  1410.                FF, SQ, BQ, CB
  1411.       Any other codes, even ones normally legitimate in STACKEY (e.g. LA
  1412.       which doesn't have an ASCII equivalent) will produce an error
  1413.       message but only AFTER the codes prior to it on the command line
  1414.  
  1415.  
  1416.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 26
  1417.  
  1418.  
  1419.  
  1420.  
  1421.                   Documentation for STACKEY, Version 3.0
  1422.  
  1423.  
  1424.       are already sent to standard output.
  1425.  
  1426.             The special command _ is only in effect for the line it is
  1427.       issued on; you must include it on each line which you wish to send
  1428.       to standard output.  It need not be the first command on the line and a
  1429.       second _ will toggle back to real mode.
  1430.  
  1431.             If you have CED or a similar command line processor that
  1432.       allows synonyms or aliases, we suggest that you use
  1433.             CED SYN send 'stackey _&a'
  1434.  
  1435.  
  1436.       Appendix 1 to Chapter II. Two character codes
  1437.  
  1438.             Here is a list of the two character codes understood by STACKEY
  1439.       (cases where the "second" key is nnnn are shorthand for nnnn being a
  1440.       number):
  1441.  
  1442.       @ followed by
  1443.             letter, number, - or = : Alt-keystrokes
  1444.       ( followed by
  1445.             letter, number, - or = : Alt-keystrokes
  1446.       ^ followed by
  1447.             letter, 1,3,4,6,7,9, [ \ ] ^ _ ` @ : control key combinations
  1448.             0,2,5,8,.,+,-,*,/ : control key combinations (enhanced only)
  1449.             ! : ^! = Ctrl-Break)
  1450.       ~ followed by
  1451.             letter, 1,3,4,6,7,9, [ \ ] ^ _  @ : control key combinations
  1452.             0,2,5,8,.,+,-,*,/ : control key combinations (enhanced only)
  1453.             ! : ~! = Ctrl-Break)
  1454.       \ followed by
  1455.             nnn : Decimal ASCII code
  1456.       # followed by
  1457.             nnnn: repeat command (including loops)
  1458.       ) followed by
  1459.             nnnn: same as #nnnn (including loops)
  1460.       $ followed by
  1461.             $ t d p v n g l b q h e _ P T M D Y W E H m : metastrings
  1462.       * followed by
  1463.             $ t d p v n g l b q h e _ P T M D Y W E H m : metastrings
  1464.       + followed by
  1465.             N,S,C,I: turn on locks
  1466.       - followed by
  1467.             N,S,C,I: turn off locks
  1468.  
  1469.  
  1470.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 27
  1471.  
  1472.  
  1473.  
  1474.  
  1475.                   Documentation for STACKEY, Version 3.0
  1476.  
  1477.  
  1478.       : followed by
  1479.             0 1 2 3 4 5 6 7 8 9: labels (see Section III.2)
  1480.       A followed by
  1481.             number: Alt-function keys
  1482.             - = : Alt-function keys (enhanced keyboard only)
  1483.             [ ] ; ' ` \ , . / :  Alt-key combos (enhanced only)
  1484.             B : AB = Alt-Backspace (enhanced only)
  1485.             C : AC = Alt-Enter (enhanced only)
  1486.             E : AE = Alt-Esc (enhanced only)
  1487.             T : AT = Alt-Tab (enhanced only)
  1488.       B followed by
  1489.             E : BE = BIOS BEep
  1490.             S : BS = BackSpace
  1491.             T : BT = BackTab (=Shift-Tab)
  1492.       C followed by
  1493.             number: Ctrl-Function key
  1494.             - = : Ctrl-Function key (enhanced keyboard only)
  1495.             A : CA = invoke CTRLALT PLUS
  1496.             B : CB = Ctrl-Backspace
  1497.             P : CP = Ctrl-Printscr
  1498.             R : CR = Carriage Return
  1499.             T : CT = Ctrl-Tab (enhanced keyboard only)
  1500.             L : Caps-Lock (as hotkey ONLY)
  1501.       D followed by
  1502.             A : DA = Down Arrow
  1503.             E : DE = DElete
  1504.             Q : DQ = Double Quote (i.e. ")
  1505.             1, 2: D1 or D2 = Invoke Desqview main menu (Desq key)
  1506.             L : DL = Invoke Desqview Learn mode
  1507.       E followed by
  1508.             N : EN = ENd
  1509.             S : ES = EScape
  1510.       F followed by
  1511.             number: unshifted function keys
  1512.             - = : unshifted function keys (enhanced keyboard only)
  1513.             F : FF = Form Feed (Ctrl-L, ASCII 12)
  1514.       G followed by
  1515.             + - *,: Grey Plus, Minus, Star
  1516.             E C : Grey Enter (enhanced keyboard only)
  1517.             0,1,2,3,4,6,7,8,9,.: Cursor pad keys (enhanced only,
  1518.                 see Section II.2)
  1519.       H followed by
  1520.             ! + - * : Hotkeys, see Section III.6; e.g. H!(.,.)
  1521.             M: HM = HoMe
  1522.  
  1523.  
  1524.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 28
  1525.  
  1526.  
  1527.  
  1528.  
  1529.                   Documentation for STACKEY, Version 3.0
  1530.  
  1531.  
  1532.       I followed by
  1533.             N : IN = INsert
  1534.       J followed by
  1535.             0 1 2 3 4 5 6 7 8 9 : jumps (see Section III.2)
  1536.       K followed by
  1537.             1,2,3,4,6,7,8,9,0,. : Alt-Keypad (enhanced keyboard only)
  1538.             5 : Keypad unshifted 5 key (enhanced keyboard only)
  1539.             /,+,-,* : Alt-Grey keys: enhanced keyboard only
  1540.             C : Alt-Grey-Enter (Carriage return, enhanced keyboard only)
  1541.       L followed by
  1542.             A : LA = Left Arrow
  1543.             F : LF = Line Feed (Ctrl-Enter, Ctrl-J, ASCII 10)
  1544.       M followed by
  1545.             P, E : Messages with passing or eating keystroke
  1546.             nnnn : Wait minutes (see Section III.3)
  1547.       N followed by number
  1548.             0 1 2 3 4 5 6 7 8 9 : Numeric keypad
  1549.             . : Shift-Del (Numeric decimal point)
  1550.             + - * : Grey keys (near keypad)
  1551.             L : NumLock (Hotkeys only)
  1552.       P followed by
  1553.             D : PD = PageDown
  1554.             H : PH = Phony keystroke (see Section III.5)
  1555.             S : PS = Shift-PrintScreen
  1556.             U : PU = PageUp
  1557.             + - : suppress, reenable printscreen key
  1558.       Q followed by
  1559.             number : Carousel partition switch
  1560.             - = : Carousel 3.0 partition switch to partitions 11, 12
  1561.       R followed by
  1562.             A : RA = Right Arrow
  1563.       S followed by
  1564.             number : Shift Function key
  1565.             - = : Shift Function key (enhanced keyboards only)
  1566.             C : SC(..) = scan ; also SCn,m(..) (see Section III.4)
  1567.             S : SS(..) = scan silently (see Section III.4)
  1568.             H : SH(.,.) = shift mask (see Section II.7)
  1569.             P : SP = SPace
  1570.             Q : SQ = Single Quote (')
  1571.             T : ST = Shift Tab
  1572.             L : Scroll Lock (Hotkey only)
  1573.             R : SysReq (Hotkey only)
  1574.       T followed by
  1575.             A B : TAB
  1576.  
  1577.  
  1578.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 29
  1579.  
  1580.  
  1581.  
  1582.  
  1583.                   Documentation for STACKEY, Version 3.0
  1584.  
  1585.  
  1586.             E : TE = TEsseract callup (see Section II.6)
  1587.       U followed by
  1588.             A : UA = Up Arrow
  1589.       W followed by
  1590.             B : WB = Wait for buffer to be empty (see Section III.3)
  1591.             H K S : Wait for hotkey, any key, specific key (see Section
  1592.                           III.7)
  1593.             R : WR = "Wait for Request"; pauses script until a key is
  1594.                           requested (see Section III.5)
  1595.             nnn : Wait command (see Section III.3)
  1596.       X followed by
  1597.             nnnn : Hex key (see Section II.5)
  1598.       Z followed by
  1599.             + - : speedup up/down (see Section II.6)
  1600.  
  1601.  
  1602.       Appendix 2 to Chapter II.  SENDing to STDOUT
  1603.  
  1604.             The following is a revised version of part of the
  1605.       documentation from SEND by Rumsey and Simon included with
  1606.       permission.  It discusses how to use STACKEY's send to standard
  1607.       output mode invoke with an underscore in the STACKEY command line.
  1608.  
  1609.             stackey _<string>
  1610.       is an enhanced version of the ECHO command,
  1611.       ideal for sending escape sequences to the printer or screen.  We'll
  1612.       refer to it as SEND.  This appendix is primarily a tutorial on
  1613.       ECHO, SEND and redirection of output.
  1614.  
  1615.             You may be used to exploiting ECHO in your batch files but
  1616.       may not be aware that it can be invoked from the DOS command line.
  1617.       If that is the case, type in at the DOS prompt:
  1618.             echo hello
  1619.       You need to also hit <Enter> but we won't keep saying that.  The
  1620.       response is amusing but not useful.  Next try:
  1621.             echo hello > prn
  1622.       More interesting!  Still not so useful but at least if you ever
  1623.       want to use your printer as a typewriter you can do it yourself
  1624.       without needing a BASIC program which does precisely that.
  1625.  
  1626.             Now try
  1627.             echo <Ctrl G>
  1628.       where "<Ctrl G>" means to hit a "control-G", that is to depress the
  1629.       <Ctrl> key and strike the G.  With a dot matrix printer try
  1630.  
  1631.  
  1632.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 30
  1633.  
  1634.  
  1635.  
  1636.  
  1637.                   Documentation for STACKEY, Version 3.0
  1638.  
  1639.  
  1640.             echo <Ctrl G> > prn
  1641.       These are decidedly more interesting and you may even think of some
  1642.       uses for them in batch files!
  1643.  
  1644.             Next try turning off your printer, carefully aligning your
  1645.      printer paper, turning your printer back on and typing
  1646.             echo <Ctrl L> > prn
  1647.       <Ctrl L> is the command to send a "top of form" to your printer but
  1648.       if you look carefully you will discover that more than a top of
  1649.       form was sent to the printer.  ECHO automatically inserts a
  1650.       carriage return-line feed pair (CR-LF) to the end of any line so
  1651.       your last command first sent a top of form but then advanced the
  1652.       paper one additional line.  Annoying, isn't it?
  1653.  
  1654.             Next try:
  1655.             echo <Esc>
  1656.       and
  1657.             echo <Ctrl [>
  1658.       (Escape and Control-[ are the same).  This doesn't do what you
  1659.       might hope.  <Esc> is interpreted by DOS as a desire on your part
  1660.       to abort the present command and thus you cannot use ECHO at the
  1661.       command line to send an <Esc> to either the screen or your printer.
  1662.       This is unfortunate since ANSI.SYS allows you to do all sorts of
  1663.       nice things if you send the proper "escape sequences" to the screen
  1664.       and many printers can be told to turn on boldface or other neat
  1665.       things by sending escape sequences to them.  You can send such
  1666.       sequences to the printer by using some word processors (even EDLIN
  1667.       (ugh!) if you use its <Ctrl V> feature) to make a file with
  1668.       embedded escape characters which you can copy to your printer. But
  1669.       you then need to have these files around and you have files with
  1670.       embedded control characters which you may have trouble printing out
  1671.       or sending over a modem.
  1672.             SEND is intended to remedy these defects of ECHO:
  1673.             1. It does not terminate line in a CR-LF combination; one can
  1674.               add such a pair "by hand".
  1675.             2. Typing "stackey _^G" is equivalent (except for the lack of
  1676.               a CR-LF) to typing "echo <Ctrl G>" so one need not fill
  1677.               files with control characters.
  1678.             3. Typing "stackey _^['E' > prn" will send a <Esc>E to the
  1679.               printer thereby turning on "emphasized" print.
  1680.       In addition, as will be explained, SEND supports the PROMPT $-
  1681.       characters.
  1682.  
  1683.  
  1684.  
  1685.  
  1686.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 31
  1687.  
  1688.  
  1689.  
  1690.  
  1691.                   Documentation for STACKEY, Version 3.0
  1692.  
  1693.  
  1694.             SEND works much like ECHO but if the string to be echoed
  1695.       includes the caret (<Shift 6> which appears as ^), different rules
  1696.       apply.  SEND will replace ^a by the character <Ctrl A> (ASCII 1),
  1697.       etc.  ^ followed by any letter is replaced by the corresponding
  1698.       control character whether the letter is upper case or lower case.
  1699.       The remaining control characters:
  1700.             ^[=ASCII 27 (1B Hex)=<Esc>
  1701.             ^\=ASCII 28 (1C Hex)
  1702.             ^]=ASCII 29 (1D Hex)
  1703.             ^^=ASCII 30 (1E Hex)
  1704.             ^_=ASCII 31 (1F Hex)
  1705.       may be included by following a caret by the appropriate symbol.
  1706.       Obviously, ^[, the escape character will be used most often.
  1707.  
  1708.             SEND does not automatically terminate any line in a CR-LF
  1709.       (ASCII 13,ASCII 10) pair.  Thus typing "echo hello" at the DOS
  1710.       command line will result in two lines on the screen before the
  1711.       next DOS prompt: one line saying hello and the other a blank line.
  1712.       Typing
  1713.             stackey _"hello"
  1714.       will only produce the one line saying hello. If one wants the CR-LF
  1715.       pair, one can insert it "by hand"; thus
  1716.             stackey _"hello"^M^J
  1717.       will have the exact same effect  as "echo hello". As we will see in
  1718.       the next section
  1719.             stackey _"hello"$_
  1720.       is also equivalent.  It is important to remember to put in these
  1721.       CR-LF by hand if you are using SEND in a batch file to echo a
  1722.       message to the screen.  For example the four line batch file
  1723.             echo off
  1724.             cls
  1725.             stackey _"hello"
  1726.             stackey _"there"
  1727.       will produce the string "hellothere" on one line on the screen
  1728.       while adding $_ after "hello" or even replacing the last two lines
  1729.       by
  1730.             stackey _"hello"$_"there"
  1731.       will produce a two line message with one word on each line.  You
  1732.       may find BATUTIL better to use for echoing messages to the screen.
  1733.  
  1734.             SEND supports the $-metastring conventions of the DOS PROMPT
  1735.       In accordance with the general STACKEY metastring translation, a
  1736.       special interpretation is made if the $ is immediately followed by
  1737.       one of the following:
  1738.  
  1739.  
  1740.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 32
  1741.  
  1742.  
  1743.  
  1744.  
  1745.                   Documentation for STACKEY, Version 3.0
  1746.  
  1747.  
  1748.             $
  1749.             g,l,b,q
  1750.             h,_,e
  1751.             t,d,p,v,n
  1752.             P,M,D,Y,T,W,E,H,m
  1753.  
  1754.             The case of the letter following $ is significant.  The
  1755.       metastrings are described in Section II.4. $g,$l,$b,$q correspond
  1756.       to the characters >,<,|,= respectively.   You can use the ordinary
  1757.       "=" in a line starting with "stackey _", but you CANNOT type >,< or
  1758.       | in such a line since DOS will interpret these symbols as
  1759.       redirection or piping.  You must use the $-metastring instead.
  1760.       For example, if you use FANSI-CONSOLE and want to send the ANSI
  1761.       code "<esc>[>4h" typing the command
  1762.             stackey _^["[">4h
  1763.       will make a file "4h" with two bytes in it while
  1764.             stackey _^["["$g"4h"
  1765.       will do exactly what you want.
  1766.  
  1767.             $h is equivalent to ^H, ASCII 8, the "backspace" which, if
  1768.       sent to the screen, moves the cursor back one space.  Like the
  1769.       $h of the Rumsey-Simon SEND program, the Stackey SEND $h does not
  1770.       erases the previous character.  Thus
  1771.             stackey _"a"$h
  1772.       will show an "a" on the screen and
  1773.             stackey _"a"$h"b"
  1774.       will show a "b" on the screen since the cursor will backspace one
  1775.       unit and the b will overwrite the a.  But the command
  1776.             stackey _"a"$h"b">file
  1777.       will produce a file with three bytes: a,<Ctrl H>,b.
  1778.  
  1779.             $t and $d send the time and date in the form returned by the
  1780.       TIME and DATE commands.  Thus the time will appear as HH:MM:SS:hh.
  1781.       If you only want the hours and minutes to appear on the screen, you
  1782.       can use
  1783.             stackey _$t$h$h$h$h$h$h"      "
  1784.       (There are six spaces after the final $h and they are important!).
  1785.  
  1786.             One of the most useful things you can do with SEND is exploit
  1787.       the ANSI.SYS device driver.  ANSI.SYS is a file that comes with DOS
  1788.       (version 2.0 and higher).  You need to load it in your CONFIG.SYS
  1789.       file.  If you already have such a file, add a line
  1790.             device=ansi.sys
  1791.       to it and place ANSI.SYS in your root directory or, even better,
  1792.  
  1793.  
  1794.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 33
  1795.  
  1796.  
  1797.  
  1798.  
  1799.                   Documentation for STACKEY, Version 3.0
  1800.  
  1801.  
  1802.       place ANSI.SYS in a directory, say GEORGE and add a line
  1803.             device=\george\ansi.sys
  1804.       to your CONFIG.SYS file. If you don't have such a file, add one to
  1805.       your root directory with one of the above lines and while you're at
  1806.       it, you should probably add files=20 and buffers=15 (unless the
  1807.       memory of your computer is very limited).
  1808.            You can read about the syntax of the ANSI.SYS commands in the
  1809.       DOS 2.0 manual or the DOS 3.0 technical reference.  ANSI.SYS can be
  1810.       used to control screen colors on a color monitor, and attributes on
  1811.       a monochrome monitor.  For example,
  1812.             stackey _$e"[1;31;42m"
  1813.       will produce an unpleasant screen while
  1814.             stackey _$e"[1;33;44m"
  1815.       will be more to your liking.  Actually, it is best to set your
  1816.       screen colors using the DOS PROMPT command.  You can use SEND to
  1817.       call up colors and attributes for effect in batch files.  BATUTIL
  1818.       will generally give you better color control.
  1819.  
  1820.             You can also use SEND and ANSI.SYS to redefine keys in DOS.
  1821.  
  1822.             DOS, following UNIX, supports two virtual devices called
  1823.       "standard input" (stdin) and "standard output" (stdout).  Programs
  1824.       rather than sending their output to a specific device like the
  1825.       screen or printer can send them to stdout and similarly rather than
  1826.       take input from a specific device, they can take it from stdin.  If
  1827.       not specified otherwise, stdout is sent to the currently active
  1828.       screen and stdout is taken from the keyboard (i.e. the DOS command
  1829.       line).  However, one can redirect stdout to another device.  For
  1830.       this to work the program MUST send its output to stdout.  For
  1831.       example, the "main output" of the COPY command goes not to stdout
  1832.       but to the second file specified on the command line; only the
  1833.       message that COPY sends goes to stdout.  Thus "copy somefile prn"
  1834.       will print a file on your printer, but "copy somefile > prn" will
  1835.       print the error message
  1836.  
  1837.             File cannot be copied onto itself
  1838.                     0 File(s) copied
  1839.  
  1840.             If a program takes its input from stdin, that too can be
  1841.       redirected.  One redirects output using the symbol ">" and input
  1842.       using "<".
  1843.             STACKEY's SEND sends its output to stdout and that can be
  1844.       redirected, for example to a printer or file.  It takes its input
  1845.       from the keyboard rather than from stdin so one cannot redirect
  1846.  
  1847.  
  1848.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 34
  1849.  
  1850.  
  1851.  
  1852.  
  1853.                   Documentation for STACKEY, Version 3.0
  1854.  
  1855.  
  1856.       input.
  1857.  
  1858.             SEND can also be used for sending control sequences to your
  1859.       printer.  Unfortunately, the sequences to be used tend to be highly
  1860.       dependent on the brand and/or model of your printer.
  1861.       The simplest example is a one line batch file entitled tf.bat
  1862.             stackey _^L> prn
  1863.       Typing tf at the DOS command line will cause your printer to eject
  1864.       a page.  You might even want to define a function key to mean tf.
  1865.       A more sophisticated example is the five line batch file
  1866.       BOLDPRN.BAT, for IBM graphics printers:
  1867.             echo off
  1868.             cls
  1869.             stackey _$e"E"$e"G">prn
  1870.             copy %1 prn
  1871.             stackey _$e"F"$e"H">prn
  1872.       Thus typing "boldprn MYFILE" will print a boldface (=emphasized and
  1873.       doublestrike) copy of myfile on your printer.  You might consider
  1874.       adding the line:
  1875.             stackey _$P"%1 printed on "$d>prn
  1876.       before the "copy..." line.
  1877.             A particularly useful way of sending printer codes is to use
  1878.       send in CED synonyms if you have the program CED or in 4DOS
  1879.       aliases.
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.     Chapter II:PLACING KEYSTROKES IN THE BUFFER                Page 35
  1903.  
  1904.  
  1905.  
  1906.  
  1907.                   Chapter III:COMMANDS TO THE RESIDENT PORTION
  1908.  
  1909.       III.1 Overview
  1910.  
  1911.             There are various ways that you can pass commands to the
  1912.       resident part of STACKEY.  Seven discussed here: delays, repeats, the
  1913.       two types of scan, WB, WR and PH, and the color commands [],L,P
  1914.       discussed in the next chapter are just stored as special "keystrokes"
  1915.       in STACKEY's buffer so it processes them as they are reached.  The
  1916.       command to flush the buffer is acted on immediately and the command to
  1917.       quit which we discuss below is properly speaking not a command to the
  1918.       resident part but to the command line interpreter.
  1919.  
  1920.             The commands /Bxxxx/ and /Rxxxx/ are commands to the part of
  1921.       the program that loads the resident part and strictly speaking not
  1922.       commands to the resident part.
  1923.  
  1924.             Another set of commands set certain flags (toggles) which the
  1925.       resident part keeps and effect how the command line is
  1926.       interpreted.  Thus, in a certain sense these are commands to the
  1927.       interpreter but ones which are kept track of in the resident part.
  1928.       The toggles come in pairs:
  1929.             /T/ and /N/ turn test mode on and off (default is off)
  1930.             /S/, /P/ and /I/ choose among smart, patient and impatient
  1931.                processing (the default is smart)
  1932.             /C/ and /D/ turn continue mode on and off (default is off)
  1933.  
  1934.  
  1935.       III.2 Repeats and loops
  1936.  
  1937.             If you need to stack ten left arrows, you will not appreciate
  1938.       having to type LA ten times (nor do you want to take that much
  1939.       space in STACKEY's buffer).  Thus STACKEY allows a key repeat
  1940.       command.  # followed by a decimal number from 1 to 255 will result
  1941.       in the next key stroke being repeated that number of times, so
  1942.             stackey #7 F1
  1943.       will stack 7 F1's while
  1944.             stackey #7 "hello"
  1945.       will stack hhhhhhhello.  Trying to repeat a repeat command (as in
  1946.       #2#4) or a delay (as in #2W6) is not recommended.  Indeed,
  1947.       following a repeat command with anything that isn't a keystroke
  1948.       will produce unexpected effects.
  1949.  
  1950.             Sometime, you will want to repeat a set of 'keystrokes' multiple
  1951.       times (loop) and for this you need only use # followed by a number
  1952.       followed by [, the commands and ] so for example
  1953.             stackey #3["hello"]
  1954.  
  1955.  
  1956.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 36
  1957.  
  1958.  
  1959.  
  1960.  
  1961.                   Documentation for STACKEY, Version 3.0
  1962.  
  1963.  
  1964.       would enter "hellohellohello". You might try
  1965.             stackey #10[be w5]
  1966.       in a batch file which will produce 10 beeps and which would notify you
  1967.       from another room.
  1968.  
  1969.             We recommend that repeats also by handled as loops; the
  1970.       repeat command is only included for compatibility with earleir
  1971.       versions.  Future versions of STACKEY may remove support for the #
  1972.       command iwht the [..] required by loops.
  1973.  
  1974.             In addition STACKEY supports labels for use in external com files
  1975.       we might supply (or you if you have programming background) and a
  1976.       single jump command.  Taking a leaf from batch file labels, STACKEY
  1977.       labels are :0 through :9 and j7 would unconditionally jump to :7 if it
  1978.       exists.  Thus
  1979.           stackey :0 be w5 j0
  1980.       would beep forever; more properly, it will beep until you flush the
  1981.       buffer with the STACKEY hotkey AL!  As an example of how to use jumps
  1982.       look at the sample external file sample.msg and try
  1983.             STACKEY  w20 ex(sample.msg) :1 be 'yes' j0  :2'no'
  1984.       This is described in detail in Section VI.9.
  1985.  
  1986.  
  1987.       III.3 Delays
  1988.  
  1989.             There will be times that an application program will flush
  1990.       the keyboard buffer before asking for a keystroke.  This is to
  1991.       force you to respond or to make sure the response is not
  1992.       accidental.  If you just stack the strokes you want, they will get
  1993.       flushed out.  A famous example of this is 1-2-3.  STACKEY provides
  1994.       several ways to try to get around this problem: delays, two kinds of
  1995.       phony keystrokes and patient processing.  STACKEY allows you to place a
  1996.       delay into the stack so that when those strokes are gotten to, STACKEY
  1997.       will pause before inserting them in the buffer.  You specify the time
  1998.       to pause in 55 millisecond units (clock ticks; there are about 18.2 per
  1999.       second).  This is done with the command Wn where n is from 1 to
  2000.       65535 so
  2001.             stackey W36 ES
  2002.       will Wait about 2 seconds before it puts an <Esc> into the buffer.
  2003.       You can use either w or W.  65535 ticks is about one hour.  If you
  2004.       need a longer wait, you can stack multiple waits or use a loop.
  2005.       New in STACKEY 3.0 is the M command.  M is followed by an integer n
  2006.       from 1 to 65535 and delays for n minutes where a "minute" is really
  2007.       1092 clock ticks.   Each hour of delay via the M command takes 4
  2008.  
  2009.  
  2010.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 37
  2011.  
  2012.  
  2013.  
  2014.  
  2015.                   Documentation for STACKEY, Version 3.0
  2016.  
  2017.  
  2018.       bytes of buffer.  A delay of a week would require about 320
  2019.       keystrokes more than the default 128.
  2020.  
  2021.             You should distinguish between what we call delays and what
  2022.       we call waits.  For consistency with Version 1.0 we still use the
  2023.       letter W for delays.  Delays are set with the command Wnnn while
  2024.       waits are set with the {WAIT=nnn} utilities mode command.  Delays
  2025.       are commands to the resident part of STACKEY telling it to delay
  2026.       placing strokes in BIOS' buffer (or setting colors) while operating
  2027.       in the background as some underlying program is running.  Waits are
  2028.       commands to the foreground part of STACKEY telling it to loop and
  2029.       control all machine resources (although you can call up a program
  2030.       like SIDEKICK) until the wait period is over.  Thus waits will be
  2031.       useful only in rather special circumstances like demonstration
  2032.       BATch files while delays will get used more often.
  2033.  
  2034.             Delays are implemented as they are reached by the resident
  2035.       part of STACKEY.  The resident portion checks to see if BIOS' buffer
  2036.       is empty and only starts counting the delay if it is empty.  Thus,
  2037.       a command like
  2038.             stackey "1"W36"2"
  2039.       will separate the two keystrokes by 36 ticks as they are processed
  2040.       by your application program and not by when they happen to be
  2041.       placed in the keyboard buffer. In distinction to this, STACKEY
  2042.       implements waits as soon as they are reached in its interpretation
  2043.       of the command line.  Unlike other commands which look for an empty
  2044.       keyboard buffer, delays are not effected by whether you are in
  2045.       impatient, patient or smart mode.
  2046.  
  2047.             There are times you might want to pause a STACKEY script until
  2048.       the BIOS buffer is empty.  W1 will almost do that although it will
  2049.       delay for an extra 1 tick.  If you just want such a pause, use WB (Wait
  2050.       for Buffer).
  2051.  
  2052.  
  2053.       III.4 Scanning
  2054.  
  2055.             There are times that you will want to pause STACKEY until your
  2056.       application program takes a certain action.  If the application
  2057.       program announces that action with a message on the screen, then the
  2058.       SCan command is exactly what you want.  You can scan for either a
  2059.       "string" at a particular location on the screen for which the syntax
  2060.       is
  2061.             SCn,m("string")
  2062.  
  2063.  
  2064.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 38
  2065.  
  2066.  
  2067.  
  2068.  
  2069.                   Documentation for STACKEY, Version 3.0
  2070.  
  2071.  
  2072.       or you can scan for the "string" immediately preceeding the cursor
  2073.       position for which the syntax is
  2074.             SC("string")
  2075.       Do NOT place quotes around the string.  SC may be upper or lower
  2076.       case.  n,m are the row and column that you want to scan at.  The
  2077.       string will need to START at position n,m.  For example
  2078.             stackey SC2,7(hello)"there"
  2079.       would pause stackey (while your foreground application continues to
  2080.       work) until the string hello appeared in row 2 columns 7-11 and at
  2081.       that point, "there" would be entered through the keyboard.
  2082.  
  2083.             When STACKEY runs into such a command in a script it pauses
  2084.       playback in the script while remaining in the background.  To warn you
  2085.       that this has happened, it will blink the character at the current
  2086.       cursor position for a plain SC command or at position n,m for an SCn,m
  2087.       command.  If you do not want this blinking you can tell STACKEY to scan
  2088.       silently (i.e. without the blink) by using SS rather than SC.
  2089.  
  2090.             Be especially careful of SS, since, if the scanned element
  2091.       doesn't occur, you may forget what has happened and think that
  2092.       STACKEY is broken since further scripts are placed in the buffer but
  2093.       no action occurs since STACKEY is patiently scanning.
  2094.  
  2095.             There are three ways to stop a STACKEY scan.  First at the DOS
  2096.       command line, you can issue
  2097.             stackey !
  2098.       which flushes the STACKEY buffer as described in Section III.10
  2099.       below.  Secondly, you can use one of two STACKEY hotkeys.  These
  2100.       are described in Section III.6 below.  One hot key flushes the
  2101.       STACKEY buffer; the other resumes playback immediately following
  2102.       the scan command.
  2103.  
  2104.             In general, it is better not to search for too long a string.
  2105.       Ideally, you want a string of 2 or 3 characters.
  2106.  
  2107.             Here is a real life example of how to use STACKEY's scan
  2108.       command.  Magellan takes some time to read all your hard disks.  If
  2109.       you load it in a Carousel partition, you'd like it to fully load in
  2110.       an initial batch command after which you switch partitions.  While
  2111.       loading, Magellan displays the word WAIT in the upper right corner
  2112.       of the screen.  When finished it changes to LIST.  The following
  2113.       will do what you'd want:
  2114.             stackey W54 SC1,76(LI) W25 q6
  2115.             mg
  2116.  
  2117.  
  2118.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 39
  2119.  
  2120.  
  2121.  
  2122.  
  2123.                   Documentation for STACKEY, Version 3.0
  2124.  
  2125.  
  2126.       if placed in a batch file where you want to go to Carousel
  2127.       partition 6 next.
  2128.  
  2129.       III.5 The phony keystrokes
  2130.  
  2131.             Two other tools that STACKEY provides to cope with programs that
  2132.       flush their buffers after loading or even before accepting any
  2133.       input are the PHony keystroke stacked with the two key code PH as in
  2134.             stackey PH"hello"
  2135.       and the WR (wait for request) keystroke as in
  2136.             stackey WR"hello"
  2137.       When the resident part reaches such a phony keystroke, it stops
  2138.       processing the buffer until the underlying program makes any call to
  2139.       int 16.  This is the way that programs normally check for and
  2140.       process keystrokes.  The first time that a program asks if there are
  2141.       any keystrokes in the buffer, it will be told no which means that it
  2142.       won't bother to flush the buffer.  As soon as an int 16 call is
  2143.       processed, STACKEY sets itself to continue the placing of strokes
  2144.       and processing of color commands.
  2145.  
  2146.             PH will not always work the way that you would like because a
  2147.       program may use a different strategy.  If PH didn't work for you in
  2148.       version 2.0, try WR since we have changed the strategy in a way that we
  2149.       feel is likely to be more successful.  For compatibility with
  2150.       programs fro which PH worked, we have kept the version 2.0 PH but
  2151.       we believe that WR is more likely to overcome the buffer flushers.
  2152.       If you are having problems with a program flushing some of
  2153.       STACKEY's keystrokes, you can try PH but if that doesn't work, you
  2154.       can consider delays and/or using patient processing; see the
  2155.       discussion of erase *.* in the Usage notes.
  2156.  
  2157.             Alas, DOS tends to issue int 16 calls while it loads programs so
  2158.       that it will eat WRs.  You may want to find a harmless keystroke like
  2159.       Backspace and try
  2160.             stackey BS WR ....
  2161.       when loading a program.
  2162.  
  2163.  
  2164.       III.6 Hotkeys
  2165.  
  2166.             STACKEY provides four hotkeys to enable you to communicate
  2167.       with it from within application.  Since you can change what keys
  2168.       call them, we give a table which includes their two letter code and
  2169.       function:
  2170.  
  2171.  
  2172.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 40
  2173.  
  2174.  
  2175.  
  2176.  
  2177.                   Documentation for STACKEY, Version 3.0
  2178.  
  2179.  
  2180.              Code    Function         Default
  2181.             ────────────────────────────────────
  2182.              H!      Flush buffer     AL "!"
  2183.              H*      Flush scan       AL G*
  2184.              H-      Pause script     AL G-
  2185.              H+      Resume script    AL G+
  2186.  
  2187.       H! flushes the stackey and BIOS buffers, H* only has an effect when
  2188.       processing has stopped because of a scan (SC), a silent scan (SS), a
  2189.       keyboard scan (WS) as described in the next section or an H- pause.
  2190.       It flushes the scan command from the buffer and resumes operation on
  2191.       the next "keystroke".  H+ resumes playback of a script that has been
  2192.       paused by an H- or by the WH command that we'll discuss in the next
  2193.       section.  Pause here just means stopping the background STACKEY
  2194.       playback; your foreground program will continue to run.
  2195.  
  2196.             The actual hotkeys that cause an action are described by two
  2197.       pieces of data: the required shift pattern given as a subset of ACLR
  2198.       (see the description of the SH command in Section II.7) and a key.
  2199.       The key is described by one of the following:
  2200.             a one character string in quotes like "a", "A" or "+"
  2201.             the following two character code that invokes normal STACKEY
  2202.                  keystrokes:
  2203.                     F1,...,F0,F-,F=, SQ, DQ, N* or G*, N+ or G+, N- or G-,
  2204.                     PS, N0,...,N9, CR, UA, DA, LA, RA, ES, BS, DE, IN,
  2205.                     PD, PU, TB, TA, EN, HM
  2206.             special two character codes for this purpose only: CL for
  2207.                  CapsLock, SL for ScrollLock, NL for NumLock and SR for
  2208.                  SysReq
  2209.       STACKEY then uses the key associated to that single stroke and
  2210.       combines it with the given shift combination. Thus "A" and "a" are
  2211.       the same for this purpose and PU and N9 are also the same. Thus to
  2212.       say that AL "!" is the default hotkey for H! means that the buffer
  2213.       is flushed by pressing Alt+LShift+the key marked 1/!.  This is the
  2214.       same as AL "1".
  2215.  
  2216.             You can change the hotkeys in STACKEY at any time including
  2217.       the initial loading by using the syntax
  2218.             stackey HX(YY,Z)
  2219.       where X is one of !,*,+ or -, YY is a subset of CALR and Z a key
  2220.       indicator.  For example, H+(CL,"+") would make Ctrl+LShift+top row
  2221.       plus the combination to resume playback, H!(,SR) would make the
  2222.       unshifted SysReq key flush the buffer and the following would
  2223.       restore all hotkeys to their defaults if you changed them
  2224.  
  2225.  
  2226.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 41
  2227.  
  2228.  
  2229.  
  2230.  
  2231.                   Documentation for STACKEY, Version 3.0
  2232.  
  2233.  
  2234.             stackey H!(AL,"!") H*(AL,G*) H+(AL,G+) H-(AL,G-)
  2235.  
  2236.             STACKEY uses int 9 to interpret hotkeys, that is, it directly
  2237.       reads the keyboard.  Thus you cannot include STACKEY hotkeys in
  2238.       keyboard macros and if you have used a mapping program and changed
  2239.       keytops, you'll probably find that STACKEY calls the original "A"
  2240.       key "a" and not the mapped key to which you've transferred the "A"
  2241.       keytop.
  2242.  
  2243.             STACKEY traps its hotkeys and does not pass them on.
  2244.  
  2245.             Alas, most keyboards other than IBM keyboards have some
  2246.       combinations of multiple shifts plus letters which are dead
  2247.       combinations in that the keyboard will not issue any interrupt in
  2248.       response to them.  In particular, on some Northgate keyboards, the
  2249.       AL! default flush combination is dead.
  2250.  
  2251.  
  2252.       III.7 Pauses for keystrokes
  2253.  
  2254.             STACKEY will pause its playback (while not affecting the
  2255.       foreground program) until a particular key is struck with three
  2256.       different commands:
  2257.             WK   waits for any key to be struck or released
  2258.             WH   waits for the H+ hotkey to be hit; this is the same as
  2259.                   hitting the H- hotkey
  2260.             WS(XX,Y)  waits and scans the keyboard for a particular
  2261.                   combination
  2262.       The keyboard scan uses the same conventions as hotkeys so that
  2263.             stackey WS(L,"a")"hello"
  2264.       will pause stackey playback until LShift+"a" is struck. The
  2265.       hotkeys are eaten by STACKEY and not passed on to the underlying
  2266.       application program.
  2267.  
  2268.  
  2269.       III.8 Multiple STACKEY commands
  2270.  
  2271.             If you are just stacking keystrokes, you can place strokes on
  2272.       more than one line of a BATch file; that is there is no difference
  2273.       in the effect of
  2274.             stackey "hello there"
  2275.       and
  2276.             stackey "hello "
  2277.             stackey "there"
  2278.  
  2279.  
  2280.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 42
  2281.  
  2282.  
  2283.  
  2284.  
  2285.                   Documentation for STACKEY, Version 3.0
  2286.  
  2287.  
  2288.       or even
  2289.             stackey "hello ther"
  2290.             stackey "e"
  2291.       Thus you can use separate lines for more readability or to overcome
  2292.       the length of DOS lines.  Of course with two commands, stackey will
  2293.       load twice but it is so small that even on a floppy based system,
  2294.       it should be in DOS' buffers and that won't slow things down.  On a
  2295.       floppy based system, extra lines in a BATch file will slow things
  2296.       down.
  2297.  
  2298.             Because utilities mode commands are processed in real time,
  2299.       there is a subtle difference between how multiple lines are
  2300.       processed when there are utilities commands on the second line but
  2301.       for virtually all situations this distinction won't matter.  Here
  2302.       is a special situation where it will:  You start on a monochrome
  2303.       monitor on a dual monitor system and issue
  2304.             stackey L4 {mon=c}
  2305.       and the monitor switch will take place before the color change. But
  2306.       with
  2307.             stackey L4
  2308.             stackey {mon=c}
  2309.       the attempted color change takes place before switching monitors
  2310.       and so have no effect.  Of course if you want to use two lines just
  2311.       reverse the order!
  2312.  
  2313.  
  2314.       III.9 Patient, impatient and smart processing
  2315.             STACKEY must cope with the fact that BIOS only provides a
  2316.       keyboard buffer of 15 strokes.  You may have software which
  2317.       enlarges this buffer for your actual typing but STACKEY cannot know
  2318.       about this.  Thus STACKEY keeps its own internal buffer.  When
  2319.       there are keystrokes waiting in this buffer, STACKEY checks 18.2
  2320.       times a second to see the state of BIOS' buffer.  Depending on the
  2321.       command and the mode you set, STACKEY will either check to see if
  2322.       the buffer is empty before placing any strokes in or will at least
  2323.       check whether there is room before placing strokes in.  STACKEY's
  2324.       inpatient mode, places as many strokes in the buffer as will fit.
  2325.       Its patient mode will place no strokes in the buffer unless the
  2326.       BIOS buffer is completely empty in which case only one stroke or
  2327.       command will be acted upon.
  2328.  
  2329.             STACKEY, by default, treats keystrokes impatiently while
  2330.       treating certain commands patiently, i.e. not implementing them
  2331.       until BIOS' stack is empty.  A typical example is a color change.
  2332.  
  2333.  
  2334.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 43
  2335.  
  2336.  
  2337.  
  2338.  
  2339.                   Documentation for STACKEY, Version 3.0
  2340.  
  2341.  
  2342.       Temporary color changes are wiped out by a change of video mode so,
  2343.       if you are loading a program which switches into graphics mode, you
  2344.       want to be sure that the colors do not change until after the
  2345.       program has loaded and changed modes.  You can do this by
  2346.       experimenting with delay length, but if you also want to send
  2347.       keystrokes to the program, the default processing method is better.
  2348.       By preceding the color change command with some keystrokes, you can
  2349.       be sure that the color command will not be acted upon until the
  2350.       application program has loaded and no delay is necessary.  We call
  2351.       this default mode smart processing.
  2352.  
  2353.             Smart processing effects the following commands which are all
  2354.       discussed in later chapters:  Ln,Pn,+/-B and [...] (but not
  2355.       commands that change permanent palettes, i.e. [#...] commands).  It
  2356.       also effects the PS command discussed in the last chapter (PrtSc).
  2357.       The Wn delay command is always handled smartly whether or not you
  2358.       have turned smart processing on or not.
  2359.  
  2360.             There are times that you will NOT want smart processing.  For
  2361.       example, in the demonstration BATch files CGACOLOR.BAT and
  2362.       COLOR.BAT, there are commands to change colors for illustration
  2363.       purposes.  If smart processing were in effect, the color changes
  2364.       would stop if the user happens to hit a key by mistake.  For this
  2365.       reason there are commands to force impatient processing for all
  2366.       situations except Wnn commands and to turn smart processing back
  2367.       on.
  2368.             stackey /i/
  2369.       turns impatient processing on and
  2370.             stackey /s/
  2371.       turns smart processing back on.  The /i/ and /s/ must be the first
  2372.       thing on the line and we urge you to take this change seriously by
  2373.       placing only this single command on a line. Either S or s and
  2374.       either I or i are allowed.  S obviously stands for smart; I stands
  2375.       for idiotic or impatient but not for intelligent.
  2376.  
  2377.             Delays (the W command) are always treated patiently even if
  2378.       impatient mode is on.  If you are in a situation where you wish
  2379.       that the Wn command were impatient, you may find that the {wait=n}
  2380.       command is what you want.
  2381.  
  2382.             When smart processing is turned off, color commands are acted
  2383.       on as soon as they are reached.  This may not be immediately if
  2384.       BIOS' buffer completely fills and there are keystrokes ahead of the
  2385.       color command waiting to be put into BIOS' buffer.
  2386.  
  2387.  
  2388.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 44
  2389.  
  2390.  
  2391.  
  2392.  
  2393.                   Documentation for STACKEY, Version 3.0
  2394.  
  2395.  
  2396.             Patient mode where all keystrokes are treated patiently is
  2397.       turned on with
  2398.             stackey /p/
  2399.       Since it slows down keystroke entry to only 18 per second (not much
  2400.       better than a good typist), you'll only want to use it under
  2401.       special circumstances.  Here is a typical example: the shareware
  2402.       fancy printing program BRADFORD opens by asking you the name of the
  2403.       file that you want to print followed by several questions about
  2404.       settings that you'll probably want to always answer the same way.
  2405.       This is clearly a place to use STACKEY in a BATch file with %1 as
  2406.       part of the stacked material (to be replaced by the file name).
  2407.       Alas, BRADFORD completely flushes BIOS' buffer before reading each
  2408.       and every keystroke so if STACKEY were in smart mode, all the
  2409.       strokes that you carefully arranged to have entered would be
  2410.       flushed!  But patient mode works beautifully - you need to do
  2411.       something so that the first stroke isn't entered too soon.  One
  2412.       could experiment with Wnn's but here PH works fine so the BATch
  2413.       file might read:
  2414.             stackey /p/ PH"%1"CR <more stuff>
  2415.             bradford
  2416.             stackey /s/
  2417.  
  2418.       III.10 Flushing and Quitting
  2419.  
  2420.             As long as there is room in STACKEY's internal buffer, you
  2421.       can stack additional keystrokes with a second STACKEY command, as
  2422.       we explained above.  If you enter a ! in a STACKEY command line,
  2423.       then STACKEY will flush its buffer, i.e. clear it and reset its
  2424.       internal pointer to the bottom of the stack.  It will also flush
  2425.       BIOS' buffer.  If you have an extended buffer provided by some
  2426.       other program, STACKEY will not flush that.
  2427.  
  2428.             Thus, the BATch file:
  2429.             stackey "abcdefghij1234567890"
  2430.             stackey !
  2431.       will display nothing on the screen when it is over.
  2432.  
  2433.             If STACKEY finds an ! on its command line, the interpreter
  2434.       continues processing after flushing the buffer so you may place
  2435.       other commands on the line following a !.
  2436.  
  2437.             If STACKEY finds a ; (lower case only) in its command line,
  2438.       it will quit interpreting the command line at that point.  This is
  2439.       to allow you to place comments in your BATch files.  Semi-colons
  2440.  
  2441.  
  2442.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 45
  2443.  
  2444.  
  2445.  
  2446.  
  2447.                   Documentation for STACKEY, Version 3.0
  2448.  
  2449.  
  2450.       inside {} or [] are interpreted as delimiters and not as comment
  2451.       indicators.
  2452.  
  2453.  
  2454.       III.11 Enlarging the Buffer
  2455.  
  2456.             STACKEY will use a default buffer allowing 128 keystrokes to
  2457.       be stacked.  The first time that STACKEY is loaded, you can tell it
  2458.       to set aside a larger buffer by including the letter B (or b;
  2459.       stands for Buffer) and the buffer size in number of strokes
  2460.       between slashes so
  2461.             stackey /B2000/"hello there"
  2462.       as an initial command would set aside a 2000 stroke buffer and then
  2463.       stack "hello there" in that buffer.  Any number between 1 and 10000
  2464.       is allowed for the buffer size.  The size is given in keystrokes;
  2465.       each keystroke requires two bytes of resident memory so a buffer
  2466.       size of 2128 would increase the amount of RAM taken by the
  2467.       resident portion of STACKEY by 4000 bytes.  If you need more than 10000
  2468.       keystrokes or want to load STACKEY in high DOS memory, use the SKRES
  2469.       program described in the next section.
  2470.  
  2471.             Once STACKEY is loaded it cannot change the size of the
  2472.       buffer in the loaded copy.  Further calls to STACKEY find the
  2473.       resident copy and use it and do not load another copy.  If a copy
  2474.       is loaded and /Bxxxx/ appears on the command line, you will get an
  2475.       error message.  You can however choose to load a new copy of
  2476.       STACKEY with any buffer size you want.  The old copy remains in
  2477.       memory but will be unused; STACKEY always finds the last copy
  2478.       loaded in memory.  You tell STACKEY to load a new copy by placing
  2479.       an R (or r; stands for Reload) after the first / in the buffer
  2480.       size command so
  2481.             stackey /R2000/"hello there"
  2482.       will load a new copy of STACKEY with a 2000 stroke buffer.  Even if
  2483.       STACKEY has not already been loaded, you can load it with the
  2484.       /R.../ command.
  2485.  
  2486.             Both the /B.../ and the /R.../ commands must be the first
  2487.       thing on the command line after the name STACKEY; this is also true
  2488.       of the other /.../ commands that we will describe.  You cannot
  2489.       place more than one set of /'s on a line.  However, you can place
  2490.       multiple /../ commands within one set of brackets such as
  2491.             stackey /R2000 T I/
  2492.       which would load a new copy and turn on testing mode and off smart
  2493.       mode in this new copy (of course, stackey /T I R2000/ will first
  2494.  
  2495.  
  2496.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 46
  2497.  
  2498.  
  2499.  
  2500.  
  2501.                   Documentation for STACKEY, Version 3.0
  2502.  
  2503.  
  2504.       change the modes in the old copy and then load the new copy,
  2505.       probably not what you wanted).
  2506.  
  2507.             If STACKEY cannot fit the characters on the command line into
  2508.       it internal buffer, it prints an error message, showing you where
  2509.       the overflow occurs, beeps and places NO new characters in the
  2510.       buffer.  The beep is sent to standard output and so it may be
  2511.       redirected to nul.  The errorlevel is set to 2.  In the default
  2512.       setting STACKEY will also flush the buffer when there is an error;
  2513.       see the discussion of continue mode below.
  2514.  
  2515.  
  2516.       III.12 The SKRES program
  2517.  
  2518.             A separate program is provided whose sole purpose is to load
  2519.       STACKEY the first time.  It does not do additional command line
  2520.       processing so that you cannot include your first set of STACKEY
  2521.       commands.  It is intended for use in two circumstances: when you want a
  2522.       buffer larger than 10,000 keystrokes and when loading in a small area
  2523.       of high DOS memory.
  2524.  
  2525.             STACKEY itself will only load with a buffer of up to 10,000
  2526.       keystrokes (20,000 bytes).  SKRES allows up to 30,000 keystrokes
  2527.       (60,000 bytes).  If you wonder how one could want a buffer over
  2528.       10,000 strokes, so do we but we received the request from some
  2529.       users with large FILEKEY scripts.  The syntax is identical to that
  2530.       for STACKEY so that, for example
  2531.             skres /B30000/
  2532.       would load with the maximal buffer size.
  2533.  
  2534.             Users of 386max, QEMM, Move 'em, QRAM and other programs that
  2535.       let you load TSRs into nooks and crannies of free address space in
  2536.       the region between 640K and 1 meg, often want to load STACKEY into
  2537.       a small space.  Even though STACKEY's resident part takes under
  2538.       1.3K, loading the program and initializing it takes over 23K and
  2539.       you'll need that much free to load STACKEY.  SKRES leaves out the
  2540.       interpreter precisely to make it as small as possible so we
  2541.       recommend using it if you wish to load STACKEY's resident part into
  2542.       high memory. If skres is used, the only allowed command on its
  2543.       command line is /Bxxxx/.
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 47
  2551.  
  2552.  
  2553.  
  2554.  
  2555.                   Documentation for STACKEY, Version 3.0
  2556.  
  2557.  
  2558.       III.13 Test mode
  2559.  
  2560.             STACKEY is a powerful program.  For that reason, especially
  2561.       while debugging a BATch file, you may want to abort a BATch file
  2562.       after STACKEY displays an error message.  STACKEY has a special
  2563.       "test mode" which you invoke with
  2564.             stackey /T/
  2565.       Whenever, STACKEY issues an error message, it checks whether test
  2566.       mode is on.  If it is, it will pause processing of the BATch file
  2567.       and issue the message
  2568.             STACKEY: Abort (Y/N)?
  2569.       If you answer Y, STACKEY will place a ^C in BIOS' buffer which will
  2570.       normally cause the BATch file to ask
  2571.             Terminate batch job (Y/N)?
  2572.       and Y will stop the BATch file.  This message from STACKEY cannot
  2573.       be redirected.
  2574.  
  2575.             To be sure that you are the one to answer the Abort message,
  2576.       STACKEY flushes both BIOS' buffer and its own.
  2577.  
  2578.             To turn off test mode and restore normal processing issue
  2579.             stackey /N/
  2580.       Some users may prefer to always use test mode.
  2581.  
  2582.             While /N/ and /T/ need only be the first commands on the
  2583.       line, we suggest that you make them the only commands on the line.
  2584.  
  2585.             In order for ^C to stop the BATch file and ask "Terminate
  2586.       batch job (Y/N)?", you must have Break on.  For this reason, if
  2587.       STACKEY is in testing mode, you respond Y to "STACKEY: Abort
  2588.       (Y/N)?" and Break is off, STACKEY will turn Break on and tell you
  2589.       that it has done so.
  2590.  
  2591.  
  2592.       III.14 Continue mode
  2593.  
  2594.             If there is an error in STACKEY's command line but there are
  2595.       keystrokes pending then STACKEY, by default, assumes that you want
  2596.       the current processing aborted and it flushes both its buffer and
  2597.       BIOS' buffer.  If for some reason, you don't want this done, you
  2598.       can issue the command
  2599.             stackey /c/
  2600.       (C or c for continue).  To restore the default setting use
  2601.             stackey /d/
  2602.  
  2603.  
  2604.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 48
  2605.  
  2606.  
  2607.  
  2608.  
  2609.                   Documentation for STACKEY, Version 3.0
  2610.  
  2611.  
  2612.       (D or d for discontinue).  When continue mode is on, not only will
  2613.       what is in STACKEY's buffer at the time of the erroneous line still
  2614.       be processed but the parts of the line up to the error are also
  2615.       processed.
  2616.  
  2617.             If test mode is on, STACKEY flushes the buffer automatically
  2618.       before displaying its "Abort(Y/N)?" message; thus, if testing mode
  2619.       is on, the setting of C/D will be overridden.
  2620.  
  2621.  
  2622.       III.15 Pushing, popping and querying the flags
  2623.  
  2624.             STACKEY uses several flags to keep track of the current state
  2625.       of the following toggles: Normal vs. Test mode, Smart vs. Impatient
  2626.       vs Patient processing, Continue vs. Discontinue on error.  You can
  2627.       save this combined state and the with
  2628.             stackey /u/
  2629.       and restore from the last command of this type with
  2630.             stackey /o/
  2631.       These commands pUsh and pOp the STACKEY flags.  The initial value
  2632.       of the pushed flags is the default and only one set is pushed so
  2633.       that popping does not change the pushed values.
  2634.  
  2635.             These commands are included for you to employ if you make
  2636.       demonstration BATch files with STACKEY.  You may want to turn off
  2637.       smart processing but you can't just restore smart processing since
  2638.       the user may have turned it off.  As a courtesy, if you are making
  2639.       demonstration BATch files to be used by others and you change the
  2640.       STACKEY flags, please push them at the start and pop them at the
  2641.       end.  Since we can find no reason for you to change the hotkeys, we
  2642.       don't save their state in a push.  If you want to use a WH command
  2643.       but are unsure what to tell the user to push to resume, use WS
  2644.       instead.
  2645.  
  2646.             At any time, the command
  2647.             stackey /?/
  2648.       will send the version number, the current values of the STACKEY
  2649.       flags, the four current hotkeys and the buffer size of the active
  2650.       copy to standard output.  The state of the hotkeys output takes the
  2651.       form
  2652.             Hotkeys H!, H*, H+, H- are:  (LA,"!")  (LA,n*)  (LA,n+)  (LA,n-)
  2653.       where the indication is (set of shifts, keyname).  Be forewarned
  2654.       that one particular keyname is picked when there are several e.g.
  2655.       TB rather than TA.
  2656.  
  2657.  
  2658.     Chapter III:COMMANDS TO THE RESIDENT PORTION               Page 49
  2659.  
  2660.  
  2661.  
  2662.  
  2663.                            Chapter IV:SETTING COLORS
  2664.  
  2665.       IV.1 Color Basics: Introduction
  2666.  
  2667.             Color monitors on an IBM PC provide graphics as well as
  2668.       colors but unfortunately the attitude of the authors of many
  2669.       graphics programs seems to be that you can have any two colors you
  2670.       want so long as you want white on black.  STACKEY has tools which
  2671.       allow you to set colors on a color monitor even for programs that
  2672.       set no colors or set colors that you don't like.  There are
  2673.       separate tools for the IBM Color Graphics Adapter (CGA) and the
  2674.       Enhanced Graphics Adapter (EGA).  The EGA compatible modes of the
  2675.       VGA are supported but the new 256 color VGA modes are not supported.
  2676.       CGA users should read through the section on SETTING COLORS ON THE CGA
  2677.       and can then skip to the next chapter.  EGA users can skip the section
  2678.       on SETTING COLORS ON THE CGA but should read all the sections on color
  2679.       basics.  Special support is provided for users of Ultravision.
  2680.  
  2681.  
  2682.       IV.2 Color Basics: Graphics modes
  2683.  
  2684.             The amount of color you can have depends not only on the
  2685.       adapter but also on the particular mode.  The CGA supports
  2686.       essentially three modes:
  2687.             Text mode (mode 3 for 80 columns)
  2688.             CGA Medium Resolution mode (mode 4)
  2689.             CGA High Resolution mode (mode 6)
  2690.       Mode 3 allows 16 background colors and (normally) 8 foreground
  2691.       colors.  Mode 4 has a resolution of 320x200 and allows four colors,
  2692.       a background color which can be from among 16 possible choices and
  2693.       one of two palettes of three colors.  Mode 6 has a resolution of
  2694.       640x200 and two colors, a black background and a foreground chosen
  2695.       from among 16 choices.
  2696.  
  2697.             The EGA supports two additional modes:
  2698.             EGA medium resolution (mode 14)
  2699.             EGA high resolution (mode 16)
  2700.       Each mode is a sixteen color mode (at least if your EGA card has a
  2701.       full 256K of memory).  Mode 14 has resolution of 640x200 just like
  2702.       mode 6 (so why use mode 6? Simple, if you're the programmer; you
  2703.       can write one program for the CGA and the EGA.  If you're the user,
  2704.       there is no reason to want mode 6 over mode 14 except if you like
  2705.       programs written by lazy programmers!).  Mode 16 has the full
  2706.       640x350 resolution supported by the EGA.
  2707.  
  2708.             The VGA supports two modes more than the EGA:
  2709.             256 color medium resolution (mode 19)
  2710.  
  2711.  
  2712.     Chapter IV:SETTING COLORS                                  page 50
  2713.  
  2714.  
  2715.  
  2716.  
  2717.                   Documentation for STACKEY, Version 2.0
  2718.  
  2719.  
  2720.             VGA high resolution (mode 18)
  2721.       VGA high resolution is 640x480.  Mode 19 is much lower resolution
  2722.       (320x200) but has 256 colors out of a palette of 262,144 rather
  2723.       than the 16 colors out of 64 allowed by the EGA or the other VGA
  2724.       modes.  There is a tradeoff between number of colors and apparent
  2725.       resolution.  Television makers have known for a long time that many
  2726.       colors can fool the viewer into thinking the resolution is higher
  2727.       than it actually is.  Even though it is low resolution, graphics in
  2728.       mode 19 can be quite striking.
  2729.  
  2730.             Various so called superVGA cards, most notably those from
  2731.       Paradise and Video7 support 800x600 resolution and 256 colors with
  2732.       640x480.  Alas there is not yet a common standard so STACKEY does not
  2733.       have support for these superVGA modes.
  2734.  
  2735.             Actually, we have not included in this discussion the 40
  2736.       column text mode (mode 1 supported on the CGA and the EGA) nor the
  2737.       16 color 320x200 EGA mode (mode 13) nor the two color graphic
  2738.       modes 15 and 17 which are rarely used.
  2739.  
  2740.             If you have the full 256K memory and an enhanced color
  2741.       display, you can choose these 16 colors from among an array of 64.
  2742.       Of this, more later.
  2743.  
  2744.             Borders further complicate the possibilities.  The CGA allows
  2745.       a border in text mode.  While the EGA does also, the only
  2746.       description of the text mode border is wimpy.  In mode 4 on the
  2747.       CGA, the border is the same color as the background.  On the EGA,
  2748.       you can specify a border color differently from the background and
  2749.       it is a full border.  The same is true in mode 14.
  2750.  
  2751.             It is important to realize that a mode change will reset the
  2752.       colors to their default values (this is not always quite true on
  2753.       the EGA/VGA; see the discussion of permanent colors later).
  2754.  
  2755.  
  2756.       IV.3 Color Basics: CGA color choices
  2757.  
  2758.             The sixteen colors on the CGA are numbered as follows:
  2759.       0(0H)       Black                  8(8H)I      Dark Grey
  2760.       1(1H)   B   Blue                   9(9H)I  B   Intense Blue
  2761.       2(2H)  G    Green                 10(AH)I G    Intense Green
  2762.       3(3H)  GB   Cyan                  11(BH)I GB   Intense Cyan
  2763.       4(4H) R     Red                   12(CH)IR     Intense Red
  2764.  
  2765.  
  2766.     Chapter IV:SETTING COLORS                                  page 51
  2767.  
  2768.  
  2769.  
  2770.  
  2771.                   Documentation for STACKEY, Version 2.0
  2772.  
  2773.  
  2774.       5(5H) R B   Magenta               13(DH)IR B   Intense Magenta
  2775.       6(6H) RG    Brown                 14(EH)IRG    Yellow
  2776.       7(7H) RGB   Light Grey            15(FH)IRGB   White
  2777.             After the decimal number, we give its hex value.  The
  2778.       letters I,R,G,B describe the color in terms of 4 basic on/off
  2779.       switches determining the color: the Intensity, Red, Green and Blue
  2780.       switches.  Thus cyan is a mix of Green and Blue.  The intensity bit
  2781.       is a misnomer in that Dark Grey is not what one would think of as
  2782.       "Intense Black"; I is really a brightness and so an intenseness of
  2783.       light.  There is a connection between the IRGB switches and the
  2784.       color number.  If B has the value 1, G the value 2, R the value 4
  2785.       and I the value 8, then the CGA color value is arrived at by adding
  2786.       the values of the switches that are on.  Thus intense magenta which
  2787.       is IRB is color number 8+4+1=13.
  2788.  
  2789.  
  2790.       IV.4 Setting colors on the CGA
  2791.  
  2792.             CGA colors are set using STACKEY with two commands the L (for
  2793.       coLor) and the P for Palette command.  The P command only has effect
  2794.       in mode 4 (CGA medium resolution graphics) while the L command has a
  2795.       effect in any mode.  It is IMPORTANT that the color command only get
  2796.       issued by STACKEY after the mode has changed and to do this you may
  2797.       have to add waits and experiment with their lengths.  For example,
  2798.       if you load a program which switches to mode 4 and want a red
  2799.       background, the command
  2800.             stackey L4
  2801.       in a BATch file immediately before the line loading the program
  2802.       will not work.  Rather, the L4 command will get issued by the
  2803.       resident portion of STACKEY immediately and change the border to
  2804.       red while you are still in text mode.  The graphics program will
  2805.       then load and change modes thereby wiping out the color change you
  2806.       issued.  Instead, you should try
  2807.             stackey W36L4
  2808.       which will tell the resident portion of STACKEY to wait roughly 2
  2809.       seconds before issuing the color change command.  While this wait
  2810.       is going on, control will be passed to the application which can
  2811.       load and change modes.  If the W36 is a long enough wait, the color
  2812.       change will only take effect after the application program has
  2813.       changed modes.  But you will have to experiment to see how long a
  2814.       wait you need to put in.
  2815.  
  2816.             If you are also stacking keystrokes which will only be
  2817.       processed by the application program after it changes modes, you do
  2818.  
  2819.  
  2820.     Chapter IV:SETTING COLORS                                  page 52
  2821.  
  2822.  
  2823.  
  2824.  
  2825.                   Documentation for STACKEY, Version 2.0
  2826.  
  2827.  
  2828.       not need to stack a wait, for STACKEY only acts on the L command if
  2829.       the keyboard buffer is empty, that is if there are no strokes
  2830.       waiting for a program to process.  Even if you don't want to stack
  2831.       keystrokes, it may be easier to stack a harmless keystroke (like
  2832.       backspace) rather than experiment with delays of appropriate length.
  2833.       Depending on the program, you may be able to use PH or WR as the
  2834.       harmless keystroke.   In BATch files, you may want to turn smart
  2835.       processing (reading the buffer to check that it is empty before issuing
  2836.       a color command) off using the /i/ command discussed in Chapter III.
  2837.       Be sure to turn smart processing back on with /s/.
  2838.  
  2839.             What the coLor command does depends on mode:
  2840.             In text mode (modes 1 and 3) Ln sets the border color to n
  2841.             In medium resolution mode (mode 4) Ln sets the background to
  2842.       color n
  2843.             In high resolution node (mode 6) Ln sets the foreground color
  2844.       to color n
  2845.  
  2846.             If this choice seems odd, it is essentially the single
  2847.       globally chosen color available in each mode.  Each mode allows 16
  2848.       choices for n.  STACKEY will accept any integer value and compute n
  2849.       modulo 16.  The demonstration BATch file CGACOLOR.BAT will
  2850.       illustrate the abilities of STACKEY on the CGA.
  2851.  
  2852.             The medium resolution mode on the CGA (mode 4) is a four
  2853.       color mode.  In addition to the background color, there is a choice
  2854.       of one of two palettes:
  2855.             Palette 0: green, red, brown (color numbers 2,4,6)
  2856.             Palette 1: cyan, magenta, grey (color numbers 3,5,7)
  2857.       The default is palette 1.  You can change palettes with the P
  2858.       command.  Pn will change to palette n where n must be 0 or 1.  Like
  2859.       the L command, when smart processing is on, STACKEY will wait for
  2860.       an empty buffer before implementing the palette change.
  2861.  
  2862.             Example: To change to palette 0 on a red background, just
  2863.       before loading a program changing to mode 4 issue
  2864.             stackey W36L4P0
  2865.  
  2866.             Unfortunately, if you set colors for graphics mode with
  2867.       STACKEY and then call up a resident program that works in text mode
  2868.       like SIDEKICK (TM), when the resident program exits and you return
  2869.       to graphics mode, you will have lost your color settings. CTRLALT
  2870.       PLUS enables you to reset these color settings.
  2871.  
  2872.  
  2873.  
  2874.     Chapter IV:SETTING COLORS                                  page 53
  2875.  
  2876.  
  2877.  
  2878.  
  2879.                   Documentation for STACKEY, Version 2.0
  2880.  
  2881.  
  2882.       IV.5 Color Basics: EGA color slots and palettes
  2883.  
  2884.             The EGA/VGA carries color setting a step further than on the
  2885.       CGA.  The graphics modes special to the EGA and also the normal
  2886.       text mode are capable of showing 16 colors but those 16 colors can
  2887.       be chosen from among 64 in modes 3 and 16.  Thus the 16 choices
  2888.       should be viewed as "color slots".  Into each slot, one can map any
  2889.       one of the 64.  In the default situation, the color slots are
  2890.       filled by colors identical to the ones on the CGA but with suitable
  2891.       software (like STACKEY!), the user can change the assignment of
  2892.       colors to slots.  Such an assignment is called a palette.
  2893.       Sometimes what we are calling color slots are called palette
  2894.       numbers and the numbers we will call color labels are called
  2895.       palette parameters.
  2896.  
  2897.             The total number of palettes is approximately 8 times 10
  2898.       raised to 28th power.  To appreciate how large this number is, we
  2899.       note that if every PC in the world were equipped with an EGA and
  2900.       could check out a billion distinct possibilities each second, it
  2901.       would takes millions of years to complete the exploration of all
  2902.       the palettes.
  2903.  
  2904.  
  2905.       IV.6 Color Basics: EGA color labelling
  2906.  
  2907.             Each individual color among the 64 is gotten by blending a
  2908.       level of red, green and blue.  Each primary color can be mixed in
  2909.       at one of 4 levels (so 64=4x4x4).  Alternatively, one thinks of a
  2910.       strong red bit and a weak red bit whose presence are indicated R
  2911.       and r.  Thus, the four levels of red are none, r, R and Rr.
  2912.       Similarly, there is no blue, b, B, Bb and no green, g, G and Gg.
  2913.       Each color can be associated to a mixture of the six letters rRgGbB
  2914.       and is assigned a number by using the following values:
  2915.             B=1,G=2,R=4,b=8,g=16,r=32
  2916.       Thus, for example Rg has the value 4+16=20.  With one exception,
  2917.       the default colors are taken by looking at the CGA IRGB labels and
  2918.       replacing I by rgb.  The exception is brown in color slot 6 which
  2919.       is RG in CGA and translates to Rg in EGA.
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.     Chapter IV:SETTING COLORS                                  page 54
  2929.  
  2930.  
  2931.  
  2932.  
  2933.                   Documentation for STACKEY, Version 2.0
  2934.  
  2935.  
  2936.             To help you in exploring the colors, we have attempted to
  2937.       give them names:
  2938.  
  2939.  0(00H)        black*            32(20H) r       faint red
  2940.  1(01H)    B   blue*             33(21H) r  B    looks blue to me
  2941.  2(02H)  G     green*            34(22H) rG      looks green to me
  2942.  3(03H)  G B   cyan*             35(23H) rG B    looks cyan to me
  2943.  4(04H)R       red*              36(24H)Rr       bright red
  2944.  5(05H)R   B   magenta*          37(25H)Rr  B    hot pink
  2945.  6(06H)R G     pea green         38(26H)RrG      orange
  2946.  7(07H)R G B   grey*             39(27H)RrG B    flesh pink
  2947.  8(08H)     b  navy blue         40(28H) r   b   royal purple
  2948.  9(09H)    Bb  bright blue       41(29H) r  Bb   looks bright blue to me
  2949. 10(0AH)  G  b  glade green       42(2AH) rG  b   looks glade green to me
  2950. 11(0BH)  G Bb  powder blue       43(2BH) rG Bb   looks powder blue to me
  2951. 12(0CH)R    b  maroon            44(2CH)Rr   b   lox (smoked salmon)
  2952. 13(0DH)R   Bb  lilac             45(2DH)Rr  Bb   bright lilac
  2953. 14(0EH)R G  b  khaki             46(2EH)RrG  b   peach
  2954. 15(0FH)R G Bb  blue grey         47(2FH)RrG Bb   light lilac
  2955. 16(10H)   g    forest green      48(30H) r g     looks forest green to me
  2956. 17(11H)   gB   steel blue        49(31H) r gB    looks steel blue to me
  2957. 18(12H)  Gg    bright green      50(32H) rGg     looks bright green to me
  2958. 19(13H)  GgB   cyan green        51(33H) rGgB    looks cyan green to me
  2959. 20(14H)R  g    brown*            52(34H)Rr g     vermilion (red orange)
  2960. 21(15H)R  gB   lavender          53(35H)Rr gB    pale hot pink
  2961. 22(16H)R Gg    lime green        54(36H)RrGg     canary yellow
  2962. 23(17H)R GgB   bright cyan green 55(37H)RrGgB    cream
  2963. 24(18H)   g b  steel grey        56(38H) r g b   dark grey*
  2964. 25(19H)   gBb  cyanic blue       57(39H) r gBb   intense blue*
  2965. 26(1AH)  Gg b  intense cyan green58(3AH) rGg b   intense green*
  2966. 27(1BH)  GgBb  bright cyan       59(3BH) rGgBb   intense cyan*
  2967. 28(1CH)R  g b  chocolate brown   60(3CH)Rr g b   intense red*
  2968. 29(1DH)R  gBb  bright lilac      61(3DH)Rr gBb   intense magenta*
  2969. 30(1EH)R Gg b  bright lime green 62(3EH)RrGg b   yellow*
  2970. 31(1FH)R GgBb  bright cyan       63(3FH)RrGgBb   white*
  2971.  
  2972.             The default colors are indicated with a *.  We feel that the
  2973.       tolerable choices for background colors include blue(1), maroon
  2974.       (12), steel grey (24) and forest green (16).  Particularly
  2975.       interesting colors include  chocolate brown (28), hot pink (37),
  2976.       orange (38), lox (44), peach (46) and vermilion (52).  Among the
  2977.       combinations we like for text in graphics mode are cream on maroon
  2978.       (55 on 12) and bright cyan on blue (27 on 1).  The demonstration
  2979.       BATch files color.bat and seecolor.bat, described later allow you
  2980.  
  2981.  
  2982.     Chapter IV:SETTING COLORS                                  page 55
  2983.  
  2984.  
  2985.  
  2986.  
  2987.                   Documentation for STACKEY, Version 2.0
  2988.  
  2989.  
  2990.       to explore the EGA color combinations.  They require an EGA or VGA
  2991.       connected to an Enhanced Color Display or VGA monitor or equivalent.
  2992.  
  2993.             A palette on the EGA is thus the assignment to each color
  2994.       slot of one of the 64 color values.  This is also called a color
  2995.       mapping.  If you have mapped blue into the slot normally occupied
  2996.       by black and yellow into the slot normally occupied by grey, your
  2997.       dumb program will think it is displaying vibrant grey on black for
  2998.       you but you'll see yellow on blue.  Later we'll see how to make
  2999.       this kind of mapping with STACKEY.  While color mapping is possible
  3000.       in modes 4,6 and 14, you don't have 64 colors to choose from and
  3001.       the g and b parameters have no effect on colors in those modes.
  3002.  
  3003.  
  3004.       IV.7 Color Basics: EGA borders
  3005.  
  3006.             In addition to the sixteen colors that you can display on the
  3007.       EGA (in modes 3,13,14,16), there is a choice of border color.  While
  3008.       in principle you can set a border in any mode, the border in the
  3009.       350 line modes (modes 1,3,16) is so wimpy, you won't want to use
  3010.       it.  But the border is a full one in modes 4,6,13,14.  Unlike the
  3011.       CGA which forces the same color for background and border in mode
  3012.       4, the EGA allows these colors to be different.  The technical name
  3013.       for the border is overscan and the corresponding slot is called the
  3014.       "overscan byte".
  3015.  
  3016.  
  3017.       IV.8 Color Basics: EGA hardware considerations
  3018.  
  3019.             All our discussion has been for the EGA with 256K attached to
  3020.       an enhanced color display or equivalent.  There are some
  3021.       differences if you have less memory or an ordinary color monitor
  3022.       attached to your system.  With 64K on your EGA, even with an ECD
  3023.       you can only display four colors from a set of 16 in mode 16 (high
  3024.       res EGA graphics).  The available slots are 0,1,4,7.
  3025.  
  3026.             An ordinary color monitor attached to an EGA does not support
  3027.       mode 16 and does not support any colors but the standard 16.  We
  3028.       believe that color mapping is possible with this setup but have not
  3029.       tested it out.
  3030.  
  3031.             There is unfortunately quite a bit of variation between hues
  3032.       on different sets of the same hardware and even greater variation
  3033.       if you are using an ECD clone rather than the IBM version.  In
  3034.  
  3035.  
  3036.     Chapter IV:SETTING COLORS                                  page 56
  3037.  
  3038.  
  3039.  
  3040.  
  3041.                   Documentation for STACKEY, Version 2.0
  3042.  
  3043.  
  3044.       particular, colors 33 and 1 will look exactly alike on some
  3045.       machines and at least slightly different on others.
  3046.  
  3047.       IV.9 Setting colors on the EGA or VGA
  3048.  
  3049.             STACKEY lets you make an arbitrary mapping of colors to color
  3050.       slots.  The syntax is to place the color commands inside [].  The
  3051.       command
  3052.             stackey []
  3053.       resets the palettes to the default.  Otherwise inside [], use c=nn
  3054.       where c is either a number from 0 to 15 and represents the color
  3055.       slot or the letter o (or cap O) if you want to change the overscan
  3056.       byte.  nn can either be a number from 0 to 63 or a string of up to
  3057.       six characters from rRgGbB.  Thus
  3058.             stackey [0=62]
  3059.       and
  3060.             stackey [0=RrGgb]
  3061.       do the same thing, namely place yellow in color slot zero.
  3062.  
  3063.             As is the case for delays and CGA colors, the [] command will
  3064.       only be implemented when there is an empty keyboard buffer.  This
  3065.       means that if you are also placing keystrokes in the buffer which
  3066.       will only be absorbed after your application loads and changes
  3067.       mode, you need not (and should not) place a wait in the command
  3068.       line.  For special situations you may want to turn this smart
  3069.       processing on and off with the /p/, /s/ and /i/ commands discussed
  3070.       in Chapter III.
  3071.  
  3072.             If you do not have an EGA or VGA installed and attached to a
  3073.       color monitor, then STACKEY will issue an error message if any
  3074.       command with a [ is attempted.
  3075.  
  3076.             Several changes separated by commas, spaces or semicolons can
  3077.       be used inside a single pair of brackets.
  3078.  
  3079.             Example: It's Halloween so you want black on orange in text
  3080.       mode.  Normally your colors are the default grey on black (shame on
  3081.       you!).  Enter
  3082.             stackey [0=38,7=0]
  3083.  
  3084.             Example: You want to call up REFLEX 1.0 on the EGA from a BATch
  3085.       file REFL.BAT which first of all loads a file specified on the command
  3086.       line (normally, you'd have to hit / for menu, p for print/file submenu,
  3087.       r for read, enter the file name and hit <Enter> twice).  You also want
  3088.  
  3089.  
  3090.     Chapter IV:SETTING COLORS                                  page 57
  3091.  
  3092.  
  3093.  
  3094.  
  3095.                   Documentation for STACKEY, Version 2.0
  3096.  
  3097.  
  3098.       to change REFLEX's default colors (white on black, shame on BORLAND;
  3099.       colors have been fixed in Reflex 2.0 - hooray for Borland) to cream on
  3100.       maroon.  Your BATch file should read:
  3101.             echo off
  3102.             cls
  3103.             C:
  3104.             cd\reflex
  3105.             stackey "/pr%1"CRCR[0=12,15=55]
  3106.             reflex
  3107.       Probably you should include special handling if %1 is the empty
  3108.       variable.  If you were not placing keystrokes in the buffer, it
  3109.       would be essential to put a delay in such as
  3110.             stackey W150[0=12,15=55]
  3111.       to make sure that REFLEX has changed modes before the color change
  3112.       command takes effect.  With a stroke in the buffer, the color
  3113.       change is only implemented after REFLEX loads and processes those
  3114.       strokes.  If you have turned off smart processing, then waits will
  3115.       be necessary.
  3116.  
  3117.             Example:  Your colors are normally yellow on blue set with
  3118.       your prompt.  You want to have bright blue on lilac for text today.
  3119.       Use
  3120.             stackey [1=RBb,14=Bb]
  3121.       (We don't particularly like this combination, mind you).
  3122.  
  3123.             Example:  You want to call up a program using mode 6 graphics
  3124.       and want a cyanic blue border and blue on cyan text area.  Use
  3125.             stackey [o=gBb,0=BG,1=B]
  3126.       Yes, it is 1=B and not 7=B.  The foreground in mode 6 is color slot
  3127.       1 even though it defaults to grey.  Similarly, the foreground in
  3128.       mode 4 defaults to color slot 3.
  3129.  
  3130.             Note for users of Ultravision: In order for the temporary
  3131.       palette commands to work, if you have Ultravision installed and
  3132.       call for a [] color change, then STACKEY will turn off Ultravision
  3133.       palette locking and you will not be able to set colors with
  3134.       Ultravision without turning it back on either with a [#U..] command
  3135.       (see the next section) or from the Ultravision main menu.  CTRLALT
  3136.       PLUS' resident palette setting will only work if Ultravision's
  3137.       palette locking is turned off.
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.     Chapter IV:SETTING COLORS                                  page 58
  3145.  
  3146.  
  3147.  
  3148.  
  3149.                   Documentation for STACKEY, Version 2.0
  3150.  
  3151.  
  3152.       IV.10 Setting permanent colors on the EGA/VGA
  3153.  
  3154.             Every time the mode is changed the colors get reset by the
  3155.       EGA/VGA to their default value.  A mechanism is provided to change
  3156.       the default values to which they are reset.  These changes are made
  3157.       only for the current session on your computer.  The values are
  3158.       changed to their "real" defaults whenever you reboot.
  3159.       Nevertheless, since the choices do persist through mode changes
  3160.       they are called permanent.  Unfortunately, the place where these
  3161.       permanent palettes are kept is in ROM where they cannot be changed
  3162.       by the user or any program!  It is possible to set aside a region
  3163.       of RAM which is read instead of ROM for permanent color changes.
  3164.       Once the permanent colors are stored there, it is possible to have
  3165.       a program that changes them.  As we will describe in Chapter VII,
  3166.       the programs EGAPAL and VGAPAL set up such a region in RAM.
  3167.       STACKEY's permanent palette setting only works with one of these
  3168.       programs or with Ultravision.
  3169.  
  3170.             The syntax is
  3171.                 stackey [#m,c=nn]
  3172.       where m is the mode number in decimal.  Thus to arrange that mode
  3173.       16 always comes up with black mapped to maroon and white to cream
  3174.       use
  3175.             stackey [#16,0=12,15=55]
  3176.       As usual, the comma can be replaced by spaces or semicolons. You can
  3177.       change the permanent colors back to the default by using
  3178.             stackey [#m]
  3179.       If you replace m by A, STACKEY will make the changes to all
  3180.       palettes and, in particular
  3181.             stackey [#A]
  3182.       resets all the permanent palettes.  Acceptable values of m are
  3183.       1,3,4,6,13,14,16 and A.  Any other value, or an attempt to use this
  3184.       service without an EGA or VGA will result in the error message:
  3185.             VGAPAL is not installed
  3186.       on a VGA and similarly on an EGA.
  3187.  
  3188.             On an EGA, separate palettes are kept for each mode.  Only
  3189.       one #n is allowed within a single bracket.
  3190.  
  3191.             On a VGA only a single palette is kept.  You can set the
  3192.       palette for multiple modes with multiple uses of # sign as in
  3193.             [#3 #16 1=4,2=13]
  3194.  
  3195.  
  3196.  
  3197.  
  3198.     Chapter IV:SETTING COLORS                                  page 59
  3199.  
  3200.  
  3201.  
  3202.  
  3203.                   Documentation for STACKEY, Version 2.0
  3204.  
  3205.  
  3206.             If Ultravision is installed, you will get an error message if
  3207.       you try to use [#n..] or [#A..].  Instead you need to use [#U..] or
  3208.       [#T..]. This tells STACKEY to turn on Ultravision's palette locking
  3209.       and set its palette.  The difference between the two ultravision
  3210.       commands is that #T turns on Ultravision's palette locking only in
  3211.       text mode while #U turns it on in all modes.
  3212.  
  3213.             The color slot and color label must appear on either side of
  3214.       the equal sign with no spaces allowed.  Between different color
  3215.       settings in a multiple setting command you must place a delimiter
  3216.       (comma, semicolon or space).
  3217.  
  3218.             The permanent changes are made in "real time", that is as
  3219.       soon that part of the STACKEY command line is interpreted.  Thus
  3220.       they are not postponed by previous delays (the Wn) command although
  3221.       they are postponed by waits (the {Wait n} command). In particular,
  3222.       permanent palette changes are not delayed until there is an empty
  3223.       buffer as is the case with temporary color changes when smart
  3224.       processing is turned on (the default).
  3225.  
  3226.             You may not stack both temporary and permanent changes in
  3227.       the same bracket. Permanent changes can only be made if # is the
  3228.       first symbol immediately following [.  A delimiter (comma,
  3229.       semicolon or space) must separate the color slot numbers.  While
  3230.       you cannot place permanent and temporary changes inside of the same
  3231.       set of [], there is no reason that you can't place more than one
  3232.       set of [] on one command line with some temporary changes in one []
  3233.       and some permanent changes in the other.
  3234.  
  3235.             Color palettes made "permanent" will be properly restored by
  3236.       your popup programs when they exit.
  3237.  
  3238.       IV.11 Controlling the blinking bit
  3239.  
  3240.             As we explained, in text mode, you have 16 foreground colors
  3241.       but only 8 background colors.  Each cell on the 80x25 screen has a
  3242.       full byte describing its "attributes" so there is enough room to
  3243.       describe 16 foreground and 16 background colors but instead, by
  3244.       default, the bit that would naturally describe the intensity of
  3245.       background instead describes whether the foreground is blinking.
  3246.       One can program the EGA or VGA to suppress blinking and instead display
  3247.       the full 16 background colors.  The command
  3248.             stackey -B
  3249.       turns off the blinking choice and turns on the 16 background color
  3250.  
  3251.  
  3252.     Chapter IV:SETTING COLORS                                  page 60
  3253.  
  3254.  
  3255.  
  3256.  
  3257.                   Documentation for STACKEY, Version 2.0
  3258.  
  3259.  
  3260.       mode while the command
  3261.             stackey +B
  3262.       turns blinking back on and reverts to the 8 background color mode.
  3263.       These commands only have an effect on text modes.  Like the L,P and
  3264.       temporary [] commands, the +/-B commands are subject to smart
  3265.       processing.
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.     Chapter IV:SETTING COLORS                                  page 61
  3307.  
  3308.  
  3309.  
  3310.  
  3311.                             Chapter V:UTILITIES MODE
  3312.  
  3313.  
  3314.       V.1 Overview of Utilities Mode
  3315.  
  3316.             STACKEY offers a command line utility mode that should allow
  3317.       you to replace lots of little utilities that you might have.  In a
  3318.       sense, these utilities are completely independent of STACKEY's key
  3319.       stacking function.  The commonality of the two modes is that they
  3320.       are both naturally callable from BATch files or from CED synonyms
  3321.       and a commonality of some parts of syntax.  However, it is possible
  3322.       to use the utilities without loading the resident portion of STACKEY
  3323.       if you wish.  Stackey's send mode (Section II.12) is really a
  3324.       utility since it doesn't use the resident part of STACKEY; however,
  3325.       there is no way to use it without loading the resident portion.
  3326.  
  3327.             Utilities are called from the STACKEY command line by placing
  3328.       the desired function within braces {}.  As usual you can place any
  3329.       other STACKEY commands on the same line so long as the utility ends
  3330.       with }.  If there are other commands on the line or there is a
  3331.       final }, then the resident portion of STACKEY will be loaded if it
  3332.       has not been previously loaded.  However, if you meet two
  3333.       conditions, then the resident portion will NOT load: you must not
  3334.       place any commands on the line before the opening { and you must
  3335.       not put in a closing }.   By separating with delimiters (space or
  3336.       semicolon but NOT comma since a comma is used as a delimiter for
  3337.       multiple parameters in a single command) you can call up several
  3338.       utilities at once.  Thus, to switch to a color monitor and a block
  3339.       cursor covering the entire line you can use
  3340.             stackey {mon=c cur=0,7}
  3341.       or
  3342.             stackey {mon=c cur=0,7
  3343.       In the second case, the resident portion would not load if it were
  3344.       not already loaded whereas in the first case it would.  Placing a
  3345.       command to the stack like CR before or after the {}'s in the first
  3346.       case would have the same effect.  In the second case placing CR
  3347.       before the { would load STACKEY if it weren't already loaded.
  3348.       Placing it at the end of the line with no closing } before would
  3349.       produce an error message.
  3350.  
  3351.             It is important to realize that utilities are implemented in
  3352.       real time and in the order they occur.  Thus
  3353.             stackey {wait=360 mon=m}
  3354.       would wait 20 seconds before changing monitors while
  3355.             stackey {mon=m wait=360}
  3356.       would change to the monochrome screen and then wait 20 seconds
  3357.       before continuing the BATch file or returning control to DOS.
  3358.  
  3359.  
  3360.     Chapter V:UTILITIES MODE                                   Page 62
  3361.  
  3362.  
  3363.  
  3364.  
  3365.                   Documentation for STACKEY, Version 2.0
  3366.  
  3367.  
  3368.       Because of the real time processing of utilities, errors in syntax
  3369.       are handled a little bit differently when there are utilities
  3370.       commands on the command line.  Normally, if there is any error on
  3371.       the command line, STACKEY aborts with an error message and takes no
  3372.       action.  But since a utility command is implemented as found, if an
  3373.       error occurs afterwards STACKEY will abort with an error message
  3374.       but any utilities which have been done will not be undone.  For
  3375.       example, the line
  3376.             stackey xyz {mon=m}
  3377.       will abort with an error message and no action taken but
  3378.             stackey {mon=m} xyz
  3379.       will first switch to the monochrome screen and then abort with an
  3380.       error message (naturally on the monochrome screen).
  3381.  
  3382.             Because utilities are performed in real time while commands to
  3383.       the resident part are performed only when the entire line has been
  3384.       processed for errors, commands to the resident part will normally
  3385.       only be implemented after utilities even if they proceed the
  3386.       utilities in line. Thus
  3387.             stackey [0=1]{mon=m}
  3388.       will only issue the palette change after the monitor change.  If you
  3389.       want to have the palette change before the monitor change, you
  3390.       should use separate lines:
  3391.             stackey [0=1]
  3392.             stackey {mon=m}
  3393.       A special rule applies with waits where the commands prior to a
  3394.       wait are placed in the stack before the wait.  For example
  3395.             stackey [1=4]{w=36}[1=1]
  3396.       if you normally have a blue screen will show you a red screen for 2
  3397.       seconds.
  3398.  
  3399.  
  3400.             The precise syntax for the utilities command within braces is
  3401.       either
  3402.             FUNCTION
  3403.       or
  3404.             FUNCTION=parameter(s)
  3405.       if there are some necessary parameters.  FUNCTION uses the notion
  3406.       of minimal truncation.  Thus MON is the minimal truncation for
  3407.       MONITOR so any of MON, MONI, MONIT, MONITO and MONITOR are
  3408.       acceptable where MONITOR is indicated.  We use the shortest minimal
  3409.       truncations which avoid ambiguity so MO is not a truncation for
  3410.       MONITOR to avoid confusion with the MODE command.  To indicate that MON
  3411.       is the minimal truncation, we'll write the command at the start of the
  3412.  
  3413.  
  3414.     Chapter V:UTILITIES MODE                                   Page 63
  3415.  
  3416.  
  3417.  
  3418.  
  3419.                   Documentation for STACKEY, Version 2.0
  3420.  
  3421.  
  3422.       section describing it, and in the summary as MONitor.  In spite of this
  3423.       case, the commands are not case sensitive so {mon=m} or even {MoN=m}
  3424.       would work.
  3425.  
  3426.             You may not use any spaces before or after the = signs when
  3427.       parameters are required.  While we recommend that you do use delimiters
  3428.       between utilities, you need not so that
  3429.             stackey {mon=cw=36}
  3430.       would switch to the color monitor and wait 2 seconds.  However, if
  3431.       the command has no parameters and you use a minimal truncation, you
  3432.       must use a delimiter.  Thus
  3433.             stackey {k be=54}
  3434.       or
  3435.             stackey {keywaitbe=54}
  3436.       will both work but
  3437.             stackey {kbe=54}
  3438.       will generate an error message.
  3439.  
  3440.             The LOCK and BEEP commands let you issue several calls at
  3441.       once by separating the parameters by colons as in
  3442.             stackey {LO=-C:-N:-S}
  3443.       In addition you can call several beeps at once by using
  3444.       colons.
  3445.  
  3446.             A summary of all the commands can be found at the end of the
  3447.       documentation and in the help available from the DOS command line.
  3448.  
  3449.  
  3450.       V.2 WAITs and UNTILs
  3451.  
  3452.             Commands:Wait=nnn, UNtil=HH:MM (followed by p,t,n)
  3453.  
  3454.             There are times when you want to pause in your BATch files to
  3455.       give the user a chance to read a screen or because the action you
  3456.       want is time sensitive.  The WAIT utility command is precisely for
  3457.       such times.  The minimal truncation is W so the syntax is
  3458.             stackey {W=nnn}
  3459.       where nnn is the number of ticks for the delay.  There are roughly
  3460.       18 ticks per second and about 64K ticks per hour.  nnn must lie
  3461.       between 1 and 64K=65,535.  If a larger number is used you get an
  3462.       error message "Number out of range".
  3463.  
  3464.             If you want a delay longer than 60 minutes, you can place
  3465.       multiple waits as in
  3466.  
  3467.  
  3468.     Chapter V:UTILITIES MODE                                   Page 64
  3469.  
  3470.  
  3471.  
  3472.  
  3473.                   Documentation for STACKEY, Version 2.0
  3474.  
  3475.  
  3476.             stackey {W=64000 W=64000}
  3477.  
  3478.             Often, instead of wanting to wait for a fixed time, you want to
  3479.       wait until a fixed time.  That is, you want to hold up a pending batch
  3480.       file until a time comes.  The UNTIL command will do this.  In its
  3481.       simplest form the syntax is
  3482.             stackey {until=HH:MM}
  3483.       where HH:MM is a military (24 hour clock).  However, STACKEY will
  3484.       recognize three letters after the HH:MM.  First, a "p" will add 12
  3485.       hours so that {until=3:15p} will be interpreted as 15:15, i.e. 3:15
  3486.       pm.  p must be the first letter after HH:MM.  t for (tomorrow) will
  3487.       add 24 hours; multiple t's are allowed as is pt (but not tp).  Thus
  3488.       {until=3:15pttt} would wait until 3:15 in the afternoon, three full
  3489.       days after the current day.
  3490.  
  3491.             STACKEY does not check that the time is a legal time so that
  3492.       {until=32:15} would be interpreted as 8:15 tomorrow as would
  3493.       {until= 30:135}.
  3494.  
  3495.             Normally STACKEY computes the time that you are calling for and
  3496.       checks if that time has past.  If it has, STACKEY assumes that you've
  3497.       made a mistake and exits with an error message.  For example, if you
  3498.       enter
  3499.            STACKEY {until=3:15p}
  3500.       and it s 4:00 pm, you'll get an error message.  Of course, it may
  3501.       happen that you'll want something to happen the next 3am whether it
  3502.       is today or tomorrow.  Suppose, for example that you leave your
  3503.       machine on 24 hours a day but some resident program insists on
  3504.       reading daily alarms each day.  So you might want to reboot at 3AM
  3505.       while you sleep.  A batch file
  3506.             stackey {until=3:00}{reboot}
  3507.       will do what you want so long as you start it after midnight but if you
  3508.       start it before, you'll get an error message.  The key letter n
  3509.       tells STACKEY you want the next time that time appears.
  3510.       Explicitly, it computes the time and, if it has past adds 24 hours.
  3511.       Thus
  3512.             stackey {until=3:00n}{reboot}
  3513.       will do what is desired.  {until=HH:MMntt} will not wait two days after
  3514.       the next HH:MM.  Instead use two separate stackey commands if that
  3515.       is what you want, e.g.
  3516.             stackey {until=3:00n}{until=3:00tt}
  3517.       if you want to wait until two days after the next 3:00 am.
  3518.  
  3519.  
  3520.  
  3521.  
  3522.     Chapter V:UTILITIES MODE                                   Page 65
  3523.  
  3524.  
  3525.  
  3526.  
  3527.                   Documentation for STACKEY, Version 2.0
  3528.  
  3529.  
  3530.             If you put in a wait or until by mistake, hitting Ctrl-
  3531.       Break, ^C or <Esc> at the keyboard will cancel the wait; i.e.
  3532.       STACKEY will exit.  The remainder of the stackey command line will
  3533.       also be cancelled.
  3534.  
  3535.             You should distinguish between what we call delays and what
  3536.       we call waits.  Delays are set with the command Wnnn while waits
  3537.       are set with the {WAIT=nnn} utilities mode command.  Delays are
  3538.       commands to the resident part of STACKEY telling it to delay
  3539.       placing strokes in BIOS' buffer (or setting colors) while operating
  3540.       in the background as some foreground program is running.  Waits are
  3541.       commands to the foreground part of STACKEY telling it to loop and
  3542.       control all machine resources (although you can call up a program
  3543.       like SIDEKICK) until the wait period is over.  Thus waits will be
  3544.       useful only in rather special circumstances like demonstration
  3545.       BATch files while delays will get used more often.
  3546.  
  3547.             Delays are implemented as they are reached by the resident
  3548.       part of STACKEY.  Thus, if you send more strokes to STACKEY's
  3549.       buffer than there is room for in BIOS' buffer, STACKEY will pause in
  3550.       sending its buffer until the backlog of strokes in BIOS's buffer is
  3551.       cleared.  If there is a delay in the "strokes" waiting for STACKEY
  3552.       to process, the count in the delay will not begin until the delay
  3553.       is reached in STACKEY's buffer.  In distinction to this, STACKEY
  3554.       implements waits as soon as they are reached in its interpretation
  3555.       of the command line.
  3556.  
  3557.             As already noted, while STACKEY loops and counts time when
  3558.       involved in a wait, you can invoke a resident program like
  3559.       SIDEKICK(TM) at such a time.  STACKEY will continue to count time
  3560.       while the resident program is active and if the wait ends while the
  3561.       resident program is up, then STACKEY will exit as soon it regains
  3562.       control.
  3563.  
  3564.             WAITs are computed by using the built in real time clock on
  3565.       the PC and so should be independent of hardware so long as the IBM
  3566.       standard 55 millisecond tick rate is used.  In particular, they
  3567.       will work the same way on 4.77 MHz PC's, 6 MHz AT's, 12 MHz AT
  3568.       clones and 25 MHz Northgate 386 machines.  Other wait programs like
  3569.       the public domain WAITN.COM just program loops and will run for
  3570.       shorter times on machines with higher crystal speeds.
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.     Chapter V:UTILITIES MODE                                   Page 66
  3577.  
  3578.  
  3579.  
  3580.  
  3581.                   Documentation for STACKEY, Version 2.0
  3582.  
  3583.  
  3584.       V.3 Switching Monitors and Ports
  3585.  
  3586.             Commands:MONitor=x (x=C,M,S), Prn, COmm
  3587.  
  3588.             There are utilities to switch ports and monitors.  The command
  3589.                stackey {PRN}
  3590.       will interchange LPT1 and LPT2 so that what was previously attached
  3591.       to LPT2 will now respond to attempts to send things out LPT1 and
  3592.       vice versa.  Repeating the command will interchange them again
  3593.       restoring the status quo ante.  Similarly, {COMM} will interchange
  3594.       COM1 and COM2.  The minimal truncation for PRN is P and for COMM is
  3595.       CO.  If you are not adding the final }, you will need to use
  3596.       the full PRN or COMM if they are the last command on the
  3597.       line.  CTRLALT PLUS includes a resident program called 2ND PRINTER
  3598.       which will let you change printers from within a running program.
  3599.  
  3600.             Similarly, you can switch monitors with the MONITOR utility
  3601.       command whose minimal truncation is MON.  This however must take a
  3602.       parameter.  To switch monitors use MON=S, to force the color monitor
  3603.       use MON=C and to force the monochrome monitor use MON=M.
  3604.  
  3605.             You will also wind up on the target monitor in 80 column text
  3606.       mode after a MON command.  In addition, the cursor on the original
  3607.       monitor, if different from the target, will be removed.  Be careful
  3608.       not to use the MON command if you only have one monitor.
  3609.  
  3610.             CTRLALT PLUS, another program by the authors of STACKEY
  3611.       provides considerable support for systems with two monitors and/or
  3612.       two printers.
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.     Chapter V:UTILITIES MODE                                   Page 67
  3631.  
  3632.  
  3633.  
  3634.  
  3635.                   Documentation for STACKEY, Version 2.0
  3636.  
  3637.  
  3638.       V.4 Turning off PrintScreen
  3639.  
  3640.             Nothing can be quite as frustrating as hitting Shift-PrintScreen
  3641.       by mistake with a computer not attached to a printer!  Typically you'll
  3642.       hang losing any unsaved work.   For such purposes, STACKEY provides a
  3643.       two key code P- which turns off the ability of Shift-PrintScreen to
  3644.       work.  You do this with
  3645.             STACKEY P-
  3646.       so that it is not a utility but rather a resident command.  However,
  3647.       like the Z+/Z- speedup commands described in Section II.6, it acts much
  3648.       like a utility.  To turn the ability of Shift-PrintScrren to work
  3649.       again, use P+.
  3650.  
  3651.             This command works by turning on the byte in the BIOS data area
  3652.       that says a print screen is in process.  So, if you hit Shift-
  3653.       PrintScreen, the BIOS check that sees if there is already a print
  3654.       screen in progress, thinks there is and it exits.  This means that P-
  3655.       will not effect other programs like PIZAZZ PLUS or FRIEZE that pop up
  3656.       on the Shift-PrintScreen combination.
  3657.  
  3658.  
  3659.       V.5 Mode, Lines and Cursor Control
  3660.  
  3661.             Commands: MODe=n, UMode=n
  3662.                       LInes=25, 43 or 50
  3663.                       CUrsor=+ or -, CUrsor=n,m
  3664.  
  3665.             There are a number of utilities commands associated with the
  3666.       video display.  You will not normally want to switch modes when at
  3667.       the DOS level but might, for example, to check out color setting
  3668.       commands discussed in the last chapter.  The MODE=n command will
  3669.       switch to mode n if n is on the allowed table below.  If a not
  3670.       allowed value is used, STACKEY will abort with a syntax error
  3671.       message.  Allowed values of n are:
  3672.             On an ordinary (or Hercules) monochrome screen: 7
  3673.             On an EGA attached to a monochrome monitor: 7,15
  3674.             On a CGA: 1,3,4,6
  3675.             On an EGA attached to a color monitor: 1,3,4,6,13,14,16
  3676.             On a VGA: 1,3,4,6,13,14,16,17,18,19
  3677.       With one exception, this prevents you from trying to switch to an
  3678.       illegal mode which may produce problems.  The exception is that you
  3679.       should not try to switch to mode 16 if you have an EGA connected to
  3680.       the old fashioned color display rather than an enhanced color
  3681.       display.  For example
  3682.  
  3683.  
  3684.     Chapter V:UTILITIES MODE                                   Page 68
  3685.  
  3686.  
  3687.  
  3688.  
  3689.                   Documentation for STACKEY, Version 2.0
  3690.  
  3691.  
  3692.             stackey {mod=14}
  3693.       will switch to the medium resolution EGA 14 color graphics mode if
  3694.       issued on a color screen and if you have an EGA.  The minimal
  3695.       truncation for MODE is MOD.
  3696.  
  3697.             Some Super VGA monitors have additional modes set with a BIOS
  3698.       call identical to the standard mode change but with another mode
  3699.       number.  If you wish STACKEY to make such a call without checking that
  3700.       the mode number is legal, use the UMODE command (for User mode).
  3701.  
  3702.             LINES=25 and LINES=43 will switch to the appropriate modes if
  3703.       you have an EGA.  Many programs will not act properly in 43 line
  3704.       mode.  The minimal truncation is LI.  On a VGA, use LINES=25 or
  3705.       LINES=50 instead.  STACKEY will check on the monitor type and issue
  3706.       an error message if you use any value of lines other than 25, 43 or
  3707.       50 and if you use an illegal value for the monitor you have (e.g.
  3708.       lines=43 on a VGA).
  3709.  
  3710.             CURSOR, which takes one or two parameters, controls the
  3711.       cursor.  The minimal truncation is CU.  CU=- will remove the cursor
  3712.       and CU=+ will restore it to the standard place (lines 6 and 7 on
  3713.       the color monitor and lines 12 and 13 on the monochrome monitor).
  3714.       For certain BATch file displays, it is effective to use CU=- but
  3715.       please remember to restore the cursor with CU=+.  If you don't like
  3716.       the standard cursor you can control it with CU=m,n.  On a color
  3717.       monitor, there are 8 lines, labelled 0 through 7 and on a
  3718.       monochrome monitor 14 lines labelled 0 through 13.  The command
  3719.       CU=m,n when m and n are in the allowed values sets the cursor to
  3720.       start on line m and end on line n.  If m is less than or equal to
  3721.       n, the cursor is in one piece while if m is greater than n, the
  3722.       cursor wraps around an is in two pieces.  For example
  3723.             stackey {cu=0,7}
  3724.       produces a full height block cursor on a color monitor and
  3725.             stackey {cu=7,0}
  3726.       produces a cursor consisting of a thin roof and thin ceiling.
  3727.  
  3728.             Using improper values will typically produce unexpected
  3729.       effects, e.g. {cu=32,0} will cause the cursor to vanish (and is
  3730.       effectively the same as cu=-).
  3731.  
  3732.             Programs like CED and FANSI CONSOLE can effect the cursor at
  3733.       the DOS prompt.  In particular, on a machine with SOFTWARE CAROUSEL
  3734.       and FANSI CONSOLE, partitions with PCED had any cursor set with
  3735.       STACKEY immediately reset at the DOS level.  But in BATch files,
  3736.  
  3737.  
  3738.     Chapter V:UTILITIES MODE                                   Page 69
  3739.  
  3740.  
  3741.  
  3742.  
  3743.                   Documentation for STACKEY, Version 2.0
  3744.  
  3745.  
  3746.       STACKEY should give you complete control over the cursor.
  3747.  
  3748.             BATUTIL will let you change the position of the cursor; see
  3749.       the BATUTIL documentation for the ROw and COl commands.
  3750.  
  3751.  
  3752.       V.6 Beeps
  3753.  
  3754.             Command: BEep=n,m or BEep=n
  3755.  
  3756.             You can send variable length and frequency beeps with
  3757.       STACKEY.  In version 2.0 of STACKEY, the duration for a given set of
  3758.       parameters was machine dependent since it relied on the clock speed
  3759.       of the underlying machine although the frequency was machine
  3760.       independent.  BEEP, whose minimal truncation is BE takes two
  3761.       parameters.  The second parameter may be left blank in which case
  3762.       the comma must also be left out.  The first parameter determines
  3763.       the frequency and n is a measure of the inverse frequency so as n
  3764.       increases the pitch goes down.  The most reasonable values are n
  3765.       between 15 and 60 but any number between 1 and 256 will yield an
  3766.       audible sound.  The second number is the duration; the default is
  3767.       m=50.  You'll have to play with this one to see how it works.  The
  3768.       sample BATch file SOUNDS.BAT is not intended as competition for
  3769.       Pianoman.
  3770.  
  3771.             Multiple beeps can be stacked as in
  3772.             stackey {BE=20,40:75,55}
  3773.       In addition, you can tell STACKEY to repeat a string of beeps
  3774.       multiple times by inserting "#nnn" between "BE" and "=".  For
  3775.       example,
  3776.             stackey {BE#5=20,80:30,90:40,80}
  3777.       would play the three notes and then repeat it four more times.
  3778.  
  3779.  
  3780.       V.7 Screen dumps
  3781.  
  3782.             Commands: DUMPP, DUMPF=x,DUMPOF=x,DUMPL=x,DUMPOL=x
  3783.                  where x is a filespec
  3784.  
  3785.             STACKEY will let you send the current screen to the printer
  3786.       or a file.  The command line
  3787.             stackey {dumpp}
  3788.       will send the screen to the printer.  If the printer is not on or
  3789.       you have no printer, a standard STACKEY error message will display.
  3790.  
  3791.  
  3792.     Chapter V:UTILITIES MODE                                   Page 70
  3793.  
  3794.  
  3795.  
  3796.  
  3797.                   Documentation for STACKEY, Version 2.0
  3798.  
  3799.  
  3800.       This command simulates the pressing of <Shift-PrtSc> so if you have
  3801.       a program like Intel's QUIKBUF or Zsoft's FRIEZE which takes over
  3802.       this key combination, it will be called up instead of the screen
  3803.       printing.
  3804.  
  3805.             DUMPF, DUMPOF, DUMPL and DUMPOL which require an = and a file
  3806.       name, all dump the screen to a file.  The commands without an "O"
  3807.       append the present screen to the file if it exists while those with
  3808.       an "O" will overwrite it.  The commands with an F make the 2000
  3809.       bytes on the screen into a file.  This file will occur as one long
  3810.       line with no LF/CR pairs.  Those with an L append LF/CR pairs at
  3811.       the end of each line and so produce files with 2050 bytes.  Files
  3812.       produced with an L will be properly displayed in a file viewer like
  3813.       Vern Beurg's LIST while those produced by an F will properly TYPE
  3814.       to the screen.  If you TYPE a file with L to the screen, blank
  3815.       lines will appear in between each original line.  LIST can properly
  3816.       view files made with F if you turn wrap on but many other programs
  3817.       will have problems with files produced in that manner.
  3818.  
  3819.             The filespec placed after = is passed to DOS so the usual
  3820.       rules apply.  If there is any kind of file error whether due to an
  3821.       invalid path or an open drive door, STACKEY will exit with the
  3822.       message
  3823.             STACKEY: DOS File Error
  3824.       and set the errorlevel to 3.
  3825.  
  3826.  
  3827.       V.8 Rebooting
  3828.  
  3829.             Commands: BOOT(=c), REBOOT(=c)
  3830.             Minimal truncation NONE
  3831.  
  3832.             In rare circumstances you may want to reboot your machine
  3833.       automatically.  STACKEY only accepts the exact phrase BOOT or
  3834.       REBOOT and if it finds it looks for the next two characters.  If
  3835.       they are "=c", STACKEY initiates a cold reboot, otherwise a warm
  3836.       reboot.  The difference is the parity resetting and checking of
  3837.       memory.  While the reboot method just jumps to the instruction in
  3838.       ROM that is gone to when you turn on the machine, if you try to
  3839.       REBOOT with STACKEY and you are using SOFTWARE CAROUSEL your EMS
  3840.       board may not reset properly; a second warm reboot should clear
  3841.       that up.
  3842.  
  3843.  
  3844.  
  3845.  
  3846.     Chapter V:UTILITIES MODE                                   Page 71
  3847.  
  3848.  
  3849.  
  3850.  
  3851.                   Documentation for STACKEY, Version 2.0
  3852.  
  3853.  
  3854.       V.9 Lock Toggles
  3855.  
  3856.             Command: LOck=xy   (with x=+ or -; y=C,S,N,I)
  3857.  
  3858.             For consistency, recognizing that the lock commands like +C
  3859.       are real time utilities, the eight two character commands
  3860.       +/- C,S,N,I are available in utilities mode as {LOCK=xy}.  So to
  3861.       turn on the caps lock you could use
  3862.             stackey {LOCK=+C}
  3863.       or
  3864.             stackey +C
  3865.       The only reason to prefer the former is if you do not want STACKEY
  3866.       resident and leave off the final }.  The minimal truncation is LO.
  3867.  
  3868.             Multiple lock commands can be combined separated by colons as
  3869.       in
  3870.             stackey {lo=-C:-N:-S}
  3871.  
  3872.  
  3873.       V.10 The Halt Command
  3874.  
  3875.       Command:HAlt
  3876.             STACKEY offers a command which halts a batch file in
  3877.       midstream.  You'd use it most often after an if command as in
  3878.             if errorlevel 2 then STACKEY {HA}
  3879.       The HALT command first checks if Break is on and if it is not, it
  3880.       turns it on.  Then it places a ^C in the buffer so that DOS will
  3881.       pause the batch file and display the message:
  3882.             Terminate batch job (Y/N)?
  3883.       and give you an opportunity to terminate the batch file.  If you
  3884.       wish to absolutely terminate the batch file without a Y/N question
  3885.       from DOS, make the last line of the batch file the label :end and
  3886.       use
  3887.             if errorlevel 2 then goto end
  3888.  
  3889.             If STACKEY finds the Break is off and turns it on, it
  3890.       displays the message:
  3891.             STACKEY: BREAK has been turned on.
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.     Chapter V:UTILITIES MODE                                   Page 72
  3901.  
  3902.  
  3903.  
  3904.  
  3905.                   Documentation for STACKEY, Version 2.0
  3906.  
  3907.  
  3908.       V.11 Pause for input
  3909.  
  3910.       Commands:Keywait, Enterwait, Abortwait, ~abortwait
  3911.             STACKEY 2.0 had four commands to interact with keyboard input
  3912.       in batch files.  For compatibility, these are still included
  3913.       although BATUTIL has expanded and extended them.
  3914.             KEYWAIT will pause a batch file for a key to be hit.  It is
  3915.       equivalent to
  3916.             BATUTIL {ge el}
  3917.       while ENTERWAIT, which pauses until <Enter> is hit is equivalent to
  3918.             BATUTIL {ge cr}
  3919.  
  3920.             ABORTWAIT pauses until either Y or N is pressed and halts the
  3921.       batch file if Y is pressed.  It is equivalent to
  3922.             BATUTIL {ge Y N}
  3923.             if not errorlevel 2 then stackey {HA}
  3924.  
  3925.             ~ABORTWAIT pauses until either Y or N is pressed and
  3926.       halts the batch file if N is pressed.  It is equivalent to
  3927.             BATUTIL {ge N Y}
  3928.             if not errorlevel 2 then stackey {HA}
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.     Chapter V:UTILITIES MODE                                   Page 73
  3955.  
  3956.  
  3957.  
  3958.  
  3959.                              Chapter VI:ADVANCED TOPICS
  3960.  
  3961.  
  3962.           In this chapter, we discuss three distinct advanced topics.  First,
  3963.       for the reader's background, we provide a tutorial on how keystrokes
  3964.       are processed in a PC.  This may help you understand what STACKEY can
  3965.       and cannot do but for most operations that you'd want to do, it isn't
  3966.       necessary.  Then we'll discuss a powerful but potentially VERY
  3967.       DANGEROUS feature where STACKEY allows you to place any arbitrary
  3968.       sequence of machine language instructions in the middle of a STACKEY
  3969.       script.  We originally developed this INLINE feature for STACKEY's
  3970.       internal purposes.  The idea was that while we wanted to give users of
  3971.       a program like CAROUSEL access to the Qn command, it hardly seemed fair
  3972.       to make all users carry the code for that command as part of the
  3973.       RESIDENT code of STACKEY.  We thus developed INLINE code to place a
  3974.       sequence of commands as part of the playback buffer.  Thus the Carousel
  3975.       code is part of the non-resident program and is only loaded into the
  3976.       keystroke buffer when needed.  Of course, if you have long scripts that
  3977.       include INLINE commands, you'll need to increase your buffer size but
  3978.       this need will only be felt by a small set of users.  INLINE code if
  3979.       not done right can really screwup your machine - requiring a reboot or
  3980.       even lost disk data.  It should only be used by those who know what
  3981.       they are doing which means people adept in 80x86 assembly language.  If
  3982.       you are copying an inline routine supplied by someone else, be careful
  3983.       to not make any typing errors!  There is also an EXTERNAL command to
  3984.       read inline code from a binary file.  As illustrations, we have
  3985.       supplied a number of external files called *.bin.
  3986.             Finally, we will describe STACKEY's API (application program
  3987.       interface) which programs can use to talk to the resident part of
  3988.       STACKEY.  Indeed, STACKEY's nonresident part talks to the resident part
  3989.       through the API.
  3990.  
  3991.  
  3992.       VI.1 Keyboard basics: interrupts
  3993.  
  3994.             We want to explain the journey taken by a single keystroke.
  3995.       In short, hitting a key calls int 9 and the BIOS processes the
  3996.       keystroke and places it in a buffer.  Programs then call BIOS int 16
  3997.       or DOS service 8 to get keystrokes out of the buffer.  Here is more
  3998.       detail:
  3999.             Your CPU runs programs as a sequence of instructions in RAM.
  4000.       RAM is organized into bytes, each of which has a unique address.
  4001.       Normally, the CPU runs a program by sequentially going through the
  4002.       instructions but there are instructions to jump to a given address
  4003.       or to jump depending on the result of some comparison.  Programs
  4004.       call DOS services by placing certain information in the CPU
  4005.       registers (local storage in the CPU) which tell DOS what is wanted
  4006.  
  4007.  
  4008.     Chapter VI:ADVANCED TOPICS                                 Page 74
  4009.  
  4010.  
  4011.  
  4012.  
  4013.                   Documentation for STACKEY, Version 3.0
  4014.  
  4015.  
  4016.       and then turn control over to DOS.  How does the program know where
  4017.       DOS is since different versions of DOS will typically reside in
  4018.       different places?  The lowest 1K of bytes on the machine is a list
  4019.       of 256 addresses.  The instruction int nn (with nn a Hex number)
  4020.       transfers control to address nn of these 256 (with the convention
  4021.       that the first address is int 0 so int 21, the interrupt for most
  4022.       DOS services is the 34th address since 21H = 33).  This is done in
  4023.       a way that stores the current state of the machine so that if DOS
  4024.       ends its routine with an IRET (interrupt return) instruction, then
  4025.       the calling program can resume operation from where it began.
  4026.  
  4027.             What has just been described is a software interrupt, that is
  4028.       one that is called by a program actively asking for that interrupt.
  4029.       There are also hardware interrupts, indeed the notion began with
  4030.       hardware interrupts.  How does the CPU determine that a key has
  4031.       been struck?  It could periodically ask the keyboard: "Hey, any
  4032.       action for me?" but such "polling" isn't very efficient.  A better
  4033.       method is for the keyboard to tap the CPU on shoulder and say:
  4034.       "I've got something for you, buddy".  What the CPU should do is
  4035.       stop what it is doing, keep a record of where it is, process the
  4036.       stroke and return to what it is doing.  In more prosaic terms,
  4037.       hitting a key sends a signal to the interrupt controller chip which
  4038.       causes int 9 to be issued.  This transfers control to the 10th
  4039.       address in memory, information is processed on the basis of which
  4040.       key is struck and control is then returned to where the CPU was and
  4041.       the underlying program continues.
  4042.  
  4043.             The two hardware interrupts of greatest interest are int 9
  4044.       which is issued whenever a key is hit or released and int 8, the
  4045.       timer interrupt which is issued every 55 milliseconds.  These 55
  4046.       millisecond periods are called clock ticks.  There are roughly 18.2
  4047.       per second.
  4048.  
  4049.             One of the key aspects of interrupts is that a program can
  4050.       steal an interrupt.  If done responsibly, such larceny is good for
  4051.       everyone and in particular TSRs can only work because they steal
  4052.       interrupts.  Let's imagine a program that pops up whenever you hit
  4053.       Ctrl+Alt+A.  How does such a program gain control when you hit its
  4054.       hotkey?  When it loads, it looks at the address stored for int 9.
  4055.       This is the address of the routine which will be called whenever a
  4056.       key is struck.  It stores this address in its own data area and
  4057.       places the address of some of its code in the int 9 location.  Thus
  4058.       one of its routines is called whenever a key is struck.  This
  4059.       routine will look and see if the key hit was A; if it is A, then it
  4060.  
  4061.  
  4062.     Chapter VI:ADVANCED TOPICS                                 Page 75
  4063.  
  4064.  
  4065.  
  4066.  
  4067.                   Documentation for STACKEY, Version 3.0
  4068.  
  4069.  
  4070.       checks the byte where BIOS keeps the state of the shift keys and
  4071.       checks if Ctrl+Alt are depressed.  If they are, then the TSR pops
  4072.       up after doing some necessary housekeeping to reset the keyboard
  4073.       and interrupt controller.  If the key isn't for the TSR program,
  4074.       then the routine passes control to the original routine stored at
  4075.       the original int 9 address.  In this way, a chain is created of all
  4076.       the different TSRs peeking at each keystroke and passing it on if
  4077.       it isn't their hotkey.  TSR technology is more complex than this
  4078.       but this describes the basic idea.  It is only by sitting on some
  4079.       interrupt that a program can get control and so take part in the
  4080.       goings on.  STACKEY actually does most of its work by sitting on
  4081.       the timer interrupt, checking each 55 milliseconds to see if it
  4082.       still has anything to do.
  4083.  
  4084.  
  4085.       VI.2 Keyboard basics: The buffer and BIOS data area
  4086.  
  4087.             The first 1024 bytes in memory contain the interrupt table.
  4088.       The next 256 bytes form the "BIOS data area" where lots of
  4089.       miscellaneous information is kept including the number of clock
  4090.       ticks since midnight (BIOS sits on int 8 and increases this number
  4091.       every time int 8 is called) and a good deal of information about the
  4092.       keyboard.  In one byte is kept the information about the state of
  4093.       CapsLock, NumLock, ScrollLock and the Insert state.  As part of the
  4094.       same byte is kept information about which of the four shift keys is
  4095.       currently depressed (thus all 8 bits of this byte are productively
  4096.       used).
  4097.  
  4098.             34 bytes are used to deal with a type ahead buffer.  As
  4099.       we'll explain, each "normal" keystroke places two bytes in the
  4100.       buffer.  As you type, new two byte combinations are added to the
  4101.       buffer while as an application processes input, two byte
  4102.       combinations are "removed from the buffer".  Rather than actually
  4103.       remove the bytes, BIOS keeps track of the head of the active buffer
  4104.       and of its tail.  The head is the address of the next stroke to be
  4105.       processed and when it is processed all that BIOS does is move the
  4106.       head pointer up in memory.  As you hit keystrokes, they are placed
  4107.       in the buffer at the position kept by the tail pointer and it is
  4108.       moved up.  The 15 word (a word means two bytes) buffer is circular
  4109.       so that the head and tail pointers will wrap around the circle.  If
  4110.       the head has caught up to the tail, then BIOS knows that the buffer
  4111.       is empty and will so inform a program that asks.  If the tail has
  4112.       looped around and caught up with the head, BIOS knows that the type
  4113.       ahead buffer is full and will beep at you if you try to type more.
  4114.  
  4115.  
  4116.     Chapter VI:ADVANCED TOPICS                                 Page 76
  4117.  
  4118.  
  4119.  
  4120.  
  4121.                   Documentation for STACKEY, Version 3.0
  4122.  
  4123.  
  4124.       VI.3 Keyboard basics: Int 9 processing
  4125.  
  4126.             The keyboard on the original PC has its own built in micro
  4127.       processor but it is not a very clever one.  Basically, all it knows
  4128.       about is that you have depressed or released a certain key.  To it
  4129.       all keys have equal footing - it doesn't distinguish between
  4130.       shifts, locks or letter keys.  It just knows them as keys.  Each
  4131.       key has its own unique hardware scan code so that the <Esc> key has
  4132.       scan code 01, the letter "A" scan code 1EH, <F7> 41H, the Left
  4133.       shift 2AH and the Capslock 3AH. Basically, the codes are arranged
  4134.       so that on the original PC they increased from left to right in
  4135.       each row but as the position of keys migrated from one keyboard
  4136.       upgrade to the next, the old codes were kept for compatibility.
  4137.       All the codes lie between 01H and 7FH (=127).  In fact none is as
  4138.       high as 7FH but theoretically one could have 127 keys on the
  4139.       keyboard without drastic changes, but 128 or more keys each
  4140.       distinguished from the other would require a completely redesigned
  4141.       BIOS! In fact the so called enhanced keyboard is more clever.  It
  4142.       distinguishes keys like the arrow keys on the numberpad and the
  4143.       separate cursor keys pads by using a pair of codes for the arrow
  4144.       key so that in theory it could support more than 127 keys.  In
  4145.       addition, the scan codes issued by the arrow keys are dependent on
  4146.       the state of NumLock.  We will not consider the extra complications
  4147.       associated with this new keyboard again.
  4148.  
  4149.             When you hit or release a key, the microprocessor on board the
  4150.       keyboard sends a signal into the computer that activates the
  4151.       interrupt controller chip which calls int 9 in the CPU.  The CPU
  4152.       then shifts into the built in BIOS routine.  Actually, there are
  4153.       probably several onlooker TSRs that first look at each keystroke
  4154.       but let's ignore them for the time being.  The first thing that the
  4155.       BIOS does is to read the keyboard "port" for the keyboard is primed
  4156.       to report the scan code of the key hit if a key was hit or 80H plus
  4157.       the scan code if a key was released.  The keyboard will report this
  4158.       information whenever asked until it is reset which is done at the
  4159.       end of the keyboard routine.
  4160.  
  4161.             What the BIOS now does, depends on the key hit or released.
  4162.       If the capslock was the key hit, it will toggle the bit that keeps
  4163.       the capslock state; if a shift was hit, it will adjust that bit and
  4164.       if the shift was released it will adjust the bit back.  If a letter
  4165.       key was hit say "A", it will check whether there is room in the
  4166.       buffer for another keystroke and beep if there isn't.  If there is,
  4167.       it will proceed to place two bytes in the buffer.  The first byte is
  4168.  
  4169.  
  4170.     Chapter VI:ADVANCED TOPICS                                 Page 77
  4171.  
  4172.  
  4173.  
  4174.  
  4175.                   Documentation for STACKEY, Version 3.0
  4176.  
  4177.  
  4178.       the "scan code" which is usually but not always the actual hardware
  4179.       scan code.  The second byte is the ASCII code.  For the "A" key, it
  4180.       will place the actual hardware scan code 1EH as the scan code.  To
  4181.       figure out the ASCII part, it will look at the state of the shift
  4182.       keys and of Capslock.  If "a" is intended, it will place ASCII code
  4183.       61H, if "A" then 41H, if ^A then 01H and if Alt-A then 00H.  This is
  4184.       typical: if there is no ASCII code associated to the key (Ctrl-A is
  4185.       a perfectly good ASCII character but Alt-A is not), then an ASCII
  4186.       code of 00H is placed.  In that case, the "scan code" is called
  4187.       "extended ASCII code" or "second ASCII code" - both terrible names
  4188.       since it has nothing to do with the ASCII scheme.
  4189.  
  4190.             The hardware scan code for <F1> is 3BH.  Since none of the
  4191.       shifted F1 keys has an ASCII equivalent, BIOS places an ASCII code
  4192.       of 00H in as part of the word placed in the buffer for those
  4193.       keystrokes.  If it always put the actual hardware scan code of 3BH
  4194.       into that half of the word, the computer wouldn't be able to
  4195.       distinguish F1, Shift-F1, Alt-F1 and Ctrl-F1.  So what does BIOS do?
  4196.       It makes up "scan codes" as follows (!):
  4197.             F1          3BH
  4198.             S1          54H
  4199.             A1          68H
  4200.             C1          5EH
  4201.       These codes were picked for the original PC where there were 84 keys
  4202.       with codes from 00H to 53H.  Thus 54H wasn't a real scan code but on
  4203.       an AT, it is the scan code for the <SysReq> key!  It doesn't matter
  4204.       since the SysReq key doesn't put anything in the buffer.  The "scan
  4205.       code" for Ctrl-PgUp is 84H which is the hardware scan code issued
  4206.       when you RELEASE the top row <3> key.  The point is that the "scan
  4207.       code" half of the what is put in the buffer is usually but not
  4208.       always the hardware scan code.
  4209.  
  4210.             If the key struck is on the keypad, there are extra
  4211.       complications, not only because of the numlock but because of the
  4212.       special meaning of the Alt-numeric keypad.  We won't discuss the
  4213.       details of how that is handled but once you indicate that you want
  4214.       to put in an ASCII 200 say (lower left handle double corner), it is
  4215.       put in with a "scan code" of zero.  That is if the scan code is
  4216.       zero, that indicates something put in via the keypad.  So the <+>
  4217.       (ASCII code 2BH) can normally get put in the buffer with one of 3
  4218.       different "scan codes" - 00H if you use the Alt-keypad and press <4>
  4219.       and then <3> with alt depressed, 0DH if you use the top row and 4EH
  4220.       if you use the grey plus.  Since both halves of the word are in the
  4221.       buffer, programs can distinguish between the two pluses if they
  4222.  
  4223.  
  4224.     Chapter VI:ADVANCED TOPICS                                 Page 78
  4225.  
  4226.  
  4227.  
  4228.  
  4229.                   Documentation for STACKEY, Version 3.0
  4230.  
  4231.  
  4232.       wish.
  4233.  
  4234.             We have not discussed how typematic fits into all this
  4235.       (typematic is the name for the key repeat function that goes into
  4236.       effect when you hold a key down).  Given that int 9 tells BIOS when
  4237.       a key is released as well as hit, you can imagine how BIOS by
  4238.       combining int 9 and the timer interrupt can produce this effect.
  4239.  
  4240.             There is an important point to be made here.  Certain special
  4241.       combinations cause the BIOS to jump to special routines.  For
  4242.       example, if you hit <Del>, the BIOS checks to see if Ctrl+Alt are
  4243.       down and if so it jumps to a special routine with which you might be
  4244.       familiar.  First, it is quite possible for a program to intercept
  4245.       int 9 and disable Ctrl-Alt-Del!  Secondly, STACKEY can only mimic a
  4246.       Ctrl-Alt-Del, because we know exactly what the machine does when
  4247.       you press Ctrl-Alt-Del.  Perhaps, your clone is set up to play the
  4248.       star spangled banner when you hit Ctrl+Alt+$.  Unless we know what
  4249.       action it is taking, there is no way we can mimic that.  We do try
  4250.       to mimic the Ctrl+Alt+G+/- speed switch since there is a standard
  4251.       routine that many clones use to change the speed but if your clone
  4252.       uses something else, there is nothing that we can do mimic that!
  4253.       Why not just simulate hitting G+ with Ctrl+Alt depressed.  The
  4254.       problem is that while we can place strokes in the buffer, steal
  4255.       ints or set off custom routines, there is no way (at least no way
  4256.       known to us!) to steal the keyboard port and simulate the hitting
  4257.       of as key under int 9.
  4258.  
  4259.       VI.4 Keyboard basics: int 16/DOS service 8
  4260.  
  4261.             Int 9 places strokes in the buffer.  Application programs
  4262.       normally get the strokes out with int 16H (henceforth we'll drop
  4263.       the H from that) or by using DOS service 8 which actually calls
  4264.       int 16 itself.  Before calling an int, programs can place a number
  4265.       in the AH register of the CPU which tells the int which service to
  4266.       use.  Thus the expression "service 8 of DOS" means invoking the
  4267.       DOS interrupt (int 21H) with ah=8. Int 16 has several services
  4268.       including one (service 2) that tells a program the state of the
  4269.       shift keys (most programs directly look at byte 417H), one that
  4270.       tells the program whether there are any keystrokes to waiting to be
  4271.       processed (service 1) and one (service 0) that returns the next
  4272.       keystroke in the buffer, waiting for a stroke if there isn't one
  4273.       there.  If int 16, service 0 is called, then when control is passed
  4274.       back to the application program, ah contains the "scan code" part
  4275.       of the next keystroke and al the ASCII part.  The application
  4276.  
  4277.  
  4278.     Chapter VI:ADVANCED TOPICS                                 Page 79
  4279.  
  4280.  
  4281.  
  4282.  
  4283.                   Documentation for STACKEY, Version 3.0
  4284.  
  4285.  
  4286.       program is perfectly able to distinguish top row plus and grey
  4287.       plus, for example.
  4288.  
  4289.             DOS service 8 calls int 16 and proceeds to throw some of the
  4290.       information away!  Only the ASCII part of the code is returned to
  4291.       the calling program.  If this ASCII code part is zero (corresponding
  4292.       to a key combination which doesn't correspond to an ordinary ASCII
  4293.       code), then and only then, can the program get additional
  4294.       information - if DOS service 8 is immediately called again, the
  4295.       scan code part is returned which explains why it is called "second
  4296.       ASCII code".  Using the DOS service, a program cannot distinguish
  4297.       the top row plus and the grey plus.  Why use the DOS service instead
  4298.       of int 16?   About the only virtue is that you can redirect input and
  4299.       have the input used if you call the DOS service 8.  There are many
  4300.       disadvantages.  Why do some programs still persist in using the DOS
  4301.       service?  For some, it is a holdover from the era of MS-DOS
  4302.       machines; these were not 100% IBM compatible machines.  The idea
  4303.       was that while these machines might have a somewhat incompatible
  4304.       BIOS, they'd react properly to the DOS call.  For some, it is
  4305.       because their compiler insists on calling DOS.  Ironically some
  4306.       compilers (Turbo Pascal is an example!) mimic the behavior of the
  4307.       DOS call and it is recommended that with such compilers, you
  4308.       include your own int 16 routine for getting keyboard input.
  4309.  
  4310.             Most programs that flush the keyboard buffer, do it by
  4311.       calling int 16, service 1 and seeing if there is a keystroke
  4312.       waiting.  If there is, then they call service 0, get the keystroke
  4313.       and ignore it.  They then loop until they are told by service 1
  4314.       that no keys remain in the buffer.
  4315.  
  4316.             In principle, a program could bypass int 16 and directly
  4317.       remove strokes from the buffer.  Fortunately no programs do so (as
  4318.       far as we know), since such programs will have a tendency not to
  4319.       work with keyboard macro programs.  But some programs completely
  4320.       ignore int 16 and have their own keyboard handlers replacing both
  4321.       int 9 and int 16 and the BIOS buffers.  SMARTCOM II is a good
  4322.       example of this.  If you use STACKEY before loading SMARTCOM,
  4323.       you'll find that the keystrokes don't get acted on by SMARTCOM but
  4324.       appear on the screen when you exit.  This is because STACKEY places
  4325.       strokes in buffer where SMARTCOM ignores them but they get read
  4326.       when you exit SMARTCOM.  There is nothing that can be done to get
  4327.       STACKEY to work with a program like that.
  4328.  
  4329.  
  4330.  
  4331.  
  4332.     Chapter VI:ADVANCED TOPICS                                 Page 80
  4333.  
  4334.  
  4335.  
  4336.  
  4337.                   Documentation for STACKEY, Version 3.0
  4338.  
  4339.  
  4340.       VI.5 Keyboard Basics: How other programs work
  4341.  
  4342.             To understand how STACKEY works, it is useful to have some
  4343.       idea of how various kinds of other programs work.  Keyboard macro
  4344.       programs generally have two distinct parts - one that enhances int 9
  4345.       and the other enhances int 16.  The int 9 enhancement allows the
  4346.       macro program to react to strokes like Ctrl-Up which BIOS ignores.
  4347.       (Actually, the BIOS with the enhanced keyboard does interpret Ctrl-
  4348.       Up so this statement is only true of the older BIOS.)  Each macro
  4349.       program has a different set of codes used for these non-BIOS
  4350.       keystrokes - alas there is no standard - but the well known ones
  4351.       all put a word in the buffer corresponding to these strokes.  Then
  4352.       their int 16 module looks at what the "real" int 16 is about to
  4353.       report - the older BIOS would pass these strange words through.
  4354.       Since the macro program worries that the calling program won't know
  4355.       what to make of this non-standard code, if you haven't made Ctrl-up
  4356.       into a macro, the macro program will eat the non-standard code.  If
  4357.       the key is a macro key, then the macro program will return the
  4358.       strokes in the macro as int 16 is successively called.
  4359.  
  4360.             Typeahead buffer extenders typically work by seeing if the
  4361.       buffer is about to fill and if so they remove the stroke from the
  4362.       buffer and place it in their buffer.  Depending on how they are
  4363.       implemented they'll continually take out and put in the last stroke
  4364.       in the buffer or all of them.
  4365.  
  4366.             Several programs promise to improve on BIOS' typematic by
  4367.       eliminated the dreaded "cursor overshoot"  (oh horrors!).  If you
  4368.       hold down the arrow key when your application program isn't ready or
  4369.       in a situation where it can't process strokes fast enough, then BIOS
  4370.       will fill the buffer with the code for that arrow key.  The more
  4371.       intelligent typematic programs place the extra strokes in not by
  4372.       using the buffer but by stealing int 16 and responding that there is
  4373.       an arrow key ready.  In this way, they'll give strokes just at the
  4374.       rate that the application can take it and you'll get "stop on a
  4375.       dime" behavior.
  4376.  
  4377.  
  4378.       VI.6 Keyboard basics: How STACKEY works (or doesn't)
  4379.  
  4380.             STACKEY's most basic function is to simulate the entering of
  4381.       ordinary keystrokes.  It does this by placing them in the buffer.
  4382.       When smart or impatient processing is in effect, STACKEY checks
  4383.       every clock tick and if it has keystrokes waiting to be placed in
  4384.  
  4385.  
  4386.     Chapter VI:ADVANCED TOPICS                                 Page 81
  4387.  
  4388.  
  4389.  
  4390.  
  4391.                   Documentation for STACKEY, Version 3.0
  4392.  
  4393.  
  4394.       the buffer, it places as many as it can without overfilling the
  4395.       buffer.  If there is no room, it will do nothing.  If your
  4396.       application can process them that fast, STACKEY can place as many as
  4397.       18.2*15=about 270 keystrokes per second in the buffer. However,
  4398.       STACKEY doesn't prevent int 9 from being processed in the middle, so
  4399.       if you hit a key, it may wind up in the middle of the playback.
  4400.  
  4401.             The non-resident part of STACKEY keeps a translation table to
  4402.       tell it what each special symbol keystroke and letter corresponds to
  4403.       and it just places the corresponding words in STACKEY's internal
  4404.       buffer.  So you understand why each "keystroke" takes two bytes and
  4405.       the 128 keystroke default buffer is 256 bytes.  STACKEY reserves the
  4406.       "scan codes" E0 and above to tell it that a special command is in
  4407.       the buffer, like a delay or repeat.  However, XF012 would still
  4408.       work; it would place a word F012 in the keyboard buffer but the
  4409.       intermediate codes in STACKEY's buffer wold take a third byte to
  4410.       warn STACKEY that the F0 wasn't a command.
  4411.  
  4412.             Since STACKEY is only simulating the result of hitting a key
  4413.       rather than the hitting of the key itself, custom routines are
  4414.       needed to simulate each "keystroke" that doesn't place a key in the
  4415.       buffer.  Since BIOS does nothing when Ctrl-Up is hit, STACKEY has
  4416.       no primitive command for Ctrl-Up.  If your macro program or
  4417.       application program gives meaning to this stroke it is probably by
  4418.       placing its own idiosyncratic code in the buffer.  If you can find
  4419.       out what codes it is using, you can simulate them with the Xnnnn
  4420.       command.  (For some macro programs, CTRLALT PLUS' ^@R command or
  4421.       CTRLALT's ^@T which reports on what int 16 is saying will let you
  4422.       see what codes your macro program is using.)
  4423.  
  4424.             STACKEY simulates a shift depress by saving the byte at
  4425.       address 417 and changing it for the specified number of ticks to the
  4426.       requested value and then it restores the original value.  Programs
  4427.       that pop up on the shift keys do so by checking byte 417 each tick so
  4428.       they will get fooled by STACKEY.  In principle a program could popup
  4429.       on Alt+LShift by sitting on int 9 and seeing if the key hit is Alt
  4430.       or LShift and then checking whether the complementary shift is
  4431.       depressed.  The only programs we know of that do this are in the
  4432.       SWAPxx series and they do not pop up on STACKEY's SH command -
  4433.       fortunately as Tesseract programs, you can use the TE command
  4434.       instead.  There is an extra complication with the SH command that
  4435.       you should be aware of.  Suppose that you have a SH(AL,18) stacked
  4436.       and you have the Alt key depressed when the processing of the SH
  4437.       command begins.  But during the processing of the SH command, you
  4438.  
  4439.  
  4440.     Chapter VI:ADVANCED TOPICS                                 Page 82
  4441.  
  4442.  
  4443.  
  4444.  
  4445.                   Documentation for STACKEY, Version 3.0
  4446.  
  4447.  
  4448.       remove your finger from the Alt key (18 ticks is a full second
  4449.       after all). When STACKEY restores the initial state of the shifts,
  4450.       it will restore the Alt key down bit and even though your aren't
  4451.       depressing the Alt key, the keyboard will act as if you are!
  4452.       Pressing and releasing the Alt key should cure this problem, which
  4453.       fortunately should be rare.
  4454.  
  4455.             STACKEY's hotkey processing is done on int 9.  Thus if you
  4456.       have used a keyboard mapping program and changed the keytops,
  4457.       STACKEY for its hotkeys will be sensitive to the original meaning of
  4458.       the keys, not their remapped meaning.  For example, on an AT you
  4459.       might physically interchange the <Esc> and <`/~> keys and use a
  4460.       program like FANSI CONSOLE to correct for the action of the keys.
  4461.       However, if you want Alt-<Esc> to be the H+ hotkey (where by <Esc>
  4462.       you mean the key currently marked <Esc>), you'll need to use
  4463.             stackey H+(A,"`")
  4464.       since a keyboard mapper can't fool programs that sit on int 9 and
  4465.       STACKEY's int 9 handler doesn't know that you've swapped keytops.
  4466.  
  4467.             Above, we described how program tend to flush the buffer.  If
  4468.       you have 100 strokes in the STACKEY buffer, the way STACKEY works by
  4469.       default, those strokes will all get cleared out by many such schemes
  4470.       (although if the program is doing things quickly enough, it may
  4471.       clear out the BIOS buffer and find that empty before the next clock
  4472.       tick when STACKEY will refill the buffer).  You should be able to
  4473.       figure out why the PH keystroke will fool such flushers.
  4474.  
  4475.             Some programs, flush the buffer after getting any keystroke,
  4476.       disabling type ahead!  You should be able to understand why patient
  4477.       processing will normally deal with such programs.
  4478.  
  4479.             You'll find that you have to fine tune STACKEY in many ways to
  4480.       get it to overcome some strange scheme that a program has to flush
  4481.       the buffer or otherwise force you to do things its way.  It is
  4482.       unfortunate that programs work that way but if all programs worked
  4483.       properly, you wouldn't have much need for STACKEY - they would allow
  4484.       you on the command line to do what you must make a STACKEY script to
  4485.       do instead.  When a difficulty does occur, it may pay to try to use
  4486.       the knowledge in this tutorial to figure out what is going on.  We
  4487.       hope that the tools we have provided in STACKEY will let you
  4488.       overcome the difficulty.  If they don't, please let us know so we
  4489.       can attempt to add even more flexibility to STACKEY to let it solve
  4490.       those problems.
  4491.  
  4492.  
  4493.  
  4494.     Chapter VI:ADVANCED TOPICS                                 Page 83
  4495.  
  4496.  
  4497.  
  4498.  
  4499.                   Documentation for STACKEY, Version 3.0
  4500.  
  4501.  
  4502.       VI.7 Inline: Syntax
  4503.  
  4504.             Important note: STACKEY's INLINE code is powerful but
  4505.       dangerous and should only be used by those adept in assembly
  4506.       language programming.  When experimenting, act the way you would
  4507.       if you were debugging an assembly language program.  Be careful to
  4508.       be in a situation where a crash wouldn't lose any work.
  4509.  
  4510.             The syntax for inline code is:
  4511.             STACKEY IL(xx/xx/xx/xx/xx)
  4512.       where xx are hex numbers from 00 to FF.  The hex digits A-F can be
  4513.       either uppercase of lower case; do not add an explicit H.  When
  4514.       this set of commands is reached in the STACKEY script, that
  4515.       sequence of bytes will be executed as a sequence of machine
  4516.       language instructions.  Before they get issued, STACKEY pushes the
  4517.       ax,bx,cx and dx registers and when the code is done, it issues a
  4518.       RET instructions and then it pops these registers.  Thus the IL
  4519.       code can freely use the ax,bx,cx,dx registers and it can also use
  4520.       the si,ds and es registers.  Before using any other registers
  4521.       (bp,di,sp,ss,cs), be sure to push them and subsequently pop them.
  4522.       It is important that you note that STACKEY appends a RET
  4523.       instruction to the IL code so need not add one yourself; you cab
  4524.       use a RET but do not use an IRET or a FAR RET.
  4525.  
  4526.             When your code is called, cs=ds=the resident code's segment
  4527.       and es=40H, the BIOS data area.  Moreover si points to the offset
  4528.       of the first instruction; see below.   The 6 byte area ds:42H-
  4529.       ds:47H is available for user data storage; below methods are given
  4530.       for additional storage if you wish.  The word at ds:40h is the
  4531.       segment of the screen (B000 or B800).
  4532.  
  4533.             THE CODE MUST BE FULLY RELOCATABLE.  RELATIVE JUMPS ARE FINE
  4534.       BUT ABSOLUTE JUMPS ARE NOT.  STACKEY does not have its own stack
  4535.       but uses the underlying programs stack.  If you have a need for a
  4536.       large stack (only relevant if you are using an external command),
  4537.       you'll need to set one up in your inline code.  To do this you
  4538.       might need to get access to the absolute position of your code.  One
  4539.       way of doing this is to use the following inline fragment:
  4540.             \E8\00\00\58\
  4541.       (which translates as
  4542.            call $+3
  4543.            pop ax)
  4544.       will place the address of the 58 instruction (relative to CS:0000)
  4545.       in the AX register.  Another way is to use the fact that si points to
  4546.  
  4547.  
  4548.     Chapter VI:ADVANCED TOPICS                                 Page 84
  4549.  
  4550.  
  4551.  
  4552.  
  4553.                   Documentation for STACKEY, Version 3.0
  4554.  
  4555.  
  4556.       the initial instruction when your inline code is loaded.  So you could
  4557.       get a data or stack area with
  4558.            jmp short overdata      ;or, jmp short $+10  for 4 words data
  4559.            dw 0,0,0,0
  4560.            overdata:
  4561.            ...
  4562.            ...
  4563.            mov [si+2], ax       ;si+2 points to beginning of "data"
  4564.  
  4565.             Be warned that if you use this idea (or the special value of es)
  4566.       in external files, you will not be able to debug them from DOS since
  4567.       DOS loads com files with si=00 and es=cs.
  4568.  
  4569.             A STACKEY inline call of n bytes takes n+3 bytes of buffer
  4570.       space (recall that a "keystroke" takes two bytes) including the
  4571.       final ret.  And the resident code to implement inline instructions
  4572.       takes only about 50 bytes!
  4573.  
  4574.  
  4575.       VI.8 External: Syntax
  4576.  
  4577.             STACKEY also has a command to allow you to stack a compiled
  4578.       com or bin file in the place of an inline string.  The syntax is
  4579.              stackey EX(filename)
  4580.       where filename can include a drive and or path if you wish.  You
  4581.       may use any extension that you wish but it must be included as part
  4582.       of the name.  The file MUST end in a RET instruction (and not in a
  4583.       call to DOS service 4C, for example) and obey all the rules for
  4584.       inline code except the rule about no final RET (we save the inline
  4585.       writer from having to add the RET by hand but for testing COM
  4586.       files, we assume you'll want the RET on the external file).
  4587.       STACKEY will complain if there is no final RET instruction.  An EX
  4588.       command to a file of n bytes ending in ret is completely equivalent
  4589.       to an IL command of the n-1 bytes preceding the RET.
  4590.  
  4591.             The size of the external file is only limited to the size of
  4592.       STACKEY's buffer.
  4593.  
  4594.             Since an EX command requires an extra file, we'd imagine that
  4595.       you'll use EX while debugging and then translate it to IL code
  4596.       unless the code is too long to fit as IL on the DOS command line.
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.     Chapter VI:ADVANCED TOPICS                                 Page 85
  4603.  
  4604.  
  4605.  
  4606.  
  4607.                   Documentation for STACKEY, Version 3.0
  4608.  
  4609.  
  4610.       VI.9 Inline and External examples
  4611.  
  4612.             Here are some examples of how to use IL:
  4613.  
  4614.       Example 1. Pure Illustration
  4615.  
  4616.             STACKEY SC(hi) IL(b8/7/e/cd/10) ' Hello to you too.'
  4617.  
  4618.       The IL code is for
  4619.               mov  ax,0E07H
  4620.               int  10H
  4621.  
  4622.       In this example, STACKEY will scan for the word "hi" and the IL
  4623.       code will issue a BIOS beep (service E of int 10 with a character
  4624.       of ^G) and then answer you back.
  4625.  
  4626.  
  4627.       Example 2. Hide the cursor
  4628.  
  4629.             STACKEY IL(b4/1/b9/0/20/cd/10)
  4630.  
  4631.       This is equivalent to
  4632.               mov ax,1
  4633.               mov cx,2000H
  4634.               int 10H
  4635.       and will hide the cursor in real time.
  4636.  
  4637.  
  4638.       Example 3. Wait for a keystroke and eat it.
  4639.  
  4640.             STACKEY IL(31/c0/cd/16)
  4641.  
  4642.       equivalent to
  4643.             xor ax,ax
  4644.             int 16H
  4645.  
  4646.  
  4647.       Example 4. Send a FF to the printer.
  4648.  
  4649.             STACKEY IL(ba/00/00/b0/OC/cd/17)
  4650.  
  4651.       equivalent to
  4652.             mov dx,0
  4653.             mov al,0CH
  4654.  
  4655.  
  4656.     Chapter VI:ADVANCED TOPICS                                 Page 86
  4657.  
  4658.  
  4659.  
  4660.  
  4661.                   Documentation for STACKEY, Version 3.0
  4662.  
  4663.  
  4664.             int 17H
  4665.  
  4666.       Example 5. Getting and restoring the shift status
  4667.  
  4668.             STACKEY IL(26/A0/17/00/3E/A2/42/00/26/C6/06/17/00/0A/...
  4669.                          3E/A0/42/00/26/A2/17/00)
  4670.  
  4671.       translates to
  4672.             mov al,es:[17h]               ;get shift states - es=400
  4673.             mov ds:[42h],al               ;save it
  4674.             mov byte ptr es:[17h],0ah     ;set alt-shift
  4675.        and after some intermediate code
  4676.             mov     al,ds:[42h]
  4677.             mov     es:[17h],al            ;restore
  4678.  
  4679.       Example 6.
  4680.             You could write your elaborate resident program accessed by
  4681.       one of the user interrupts and call it up with STACKEY inline code
  4682.       calling that interrupt.
  4683.  
  4684.       Example 7.  Flash the screen
  4685.             This involves the sample code flash.asm and its compiled bin
  4686.       file flash.bin.  What it does is XOR all bytes in screen memory
  4687.       with 07F, count to 64K and XOR back.  The effect is to flash the
  4688.       screen so
  4689.             stackey  :1 w5 ex(flash.bin) be j1
  4690.       will get your attention that a process has stopped; use the H!
  4691.       hotkey to flush out those instructions.
  4692.  
  4693.       Example 8.  Play music
  4694.             Music.asm is source for the file gavotte.bin which will play
  4695.       a Bach gavotte with
  4696.             stackey ex(gavotte.bin)
  4697.       There are also a Monteverdi piece (montev.bin) and for the really
  4698.       highbrow pop goes the weasel (pop.bin).  Music.asm is a shell and
  4699.       you can use it to write your own external music files. You might
  4700.       try
  4701.             stackey :1 ex(gavotte.bin) WH j1
  4702.       which will play the gavotte whenever you hit the H+ hotkey.  Of
  4703.       course, you won't be able to use STACKEY for anything else.
  4704.  
  4705.       Example 9.  Messages
  4706.             The shell makemess.asm is source code for sample.msg but has
  4707.       directions for modification.  By jumping to labels called label1,
  4708.  
  4709.  
  4710.     Chapter VI:ADVANCED TOPICS                                 Page 87
  4711.  
  4712.  
  4713.  
  4714.  
  4715.                   Documentation for STACKEY, Version 3.0
  4716.  
  4717.  
  4718.       label2, etc in this source code, when run the external file will
  4719.       jump to STACKEY labels 1, 2, etc.  The sample file jumps to label 1
  4720.       if you hit Y and label 2 if you hit N.  Thus the command
  4721.             STACKEY  ex(sample.msg) :1 be 'yes' j0  :2 'no'
  4722.       will pop up a message box and either beep and enter the string
  4723.       'yes' through the keyboard if you answer Y or enter the string 'no'
  4724.       if you enter N.   Notice since there is no label 0, j0 exits the
  4725.       command line.
  4726.  
  4727.       Example 10. Disable/Reenable the keyboard
  4728.             This example is potentially very dangerous!  The following
  4729.       code will disable the keyboard:
  4730.             stackey IL(B0/AD/E6/64)
  4731.       and can be used in scripts where you want to be sure that the user
  4732.       will not interupt.  Only use it after you have thoroughly debugged
  4733.       the rest of the script.  To reenable the keyboard use instead
  4734.       stackey IL(B0/AE/E6/64).  However, be warned that some keyboards
  4735.       will save up keystrokes while disabled and issue them when
  4736.       reenabled.  For this reason, you may want to also flush the
  4737.       keyboard as well as reenable it.  An external program flush.bin is
  4738.       provide that does this or you can use
  4739.             stackey IL(B0/AE/E6/64/33/C9/E2/FE/B4/01/CD/16/
  4740.                           74/06/32/E4/CD/16/EB/EC)
  4741.  
  4742.  
  4743.       VI.10 STACKEY's API
  4744.  
  4745.             To talk to application programs, STACKEY takes over some unused
  4746.       int 16 services.  All calls require AH=CA (that's CA Hex but think of it
  4747.       as the initials of CTRLALT Associates; CTRLALT PLUS' API also uses int
  4748.       16 but with other values of BX and CX).  It is also required that
  4749.       BX=CX=736BH ('sk').  AL must be one of 0, 1 or 2 and this value
  4750.       indicates the "service number" below.  Any other values of AX,BX,CX
  4751.       will be passed on by STACKEY. Three bytes of user stack are used in
  4752.       addition to the 5 required by an interrupt.
  4753.  
  4754.             If STACKEY services an API call, it ALWAYS RETURNS
  4755.                     AX=CAFF
  4756.                     BX=Code segment of SK
  4757.                     CX=Version of SK      (CH=major,CL=minor)
  4758.       The API is only applicable for version 3.0 and later of STACKEY.
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.     Chapter VI:ADVANCED TOPICS                                 Page 88
  4765.  
  4766.  
  4767.  
  4768.  
  4769.                   Documentation for STACKEY, Version 3.0
  4770.  
  4771.  
  4772.             Here are the STACKEY API services:
  4773.  
  4774.               service 0:  Are you there?
  4775.                  Returns:   DX=Words free
  4776.  
  4777.               service 1:  Put word in buffer
  4778.                       DX=word to place in buffer
  4779.                  Returns:   DX=number of words remaining in
  4780.                       buffer if successful, FFFF if unsuccessful.
  4781.                       [The only reason for unsuccess is a full buffer.]
  4782.  
  4783.               service 2: Flush STACKEY and BIOS buffers
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.     Chapter VI:ADVANCED TOPICS                                 Page 89
  4819.  
  4820.  
  4821.  
  4822.  
  4823.                   Documentation for STACKEY, Version 3.0
  4824.  
  4825.  
  4826.  
  4827.                          Chapter VII:ASSOCIATED PROGRAMS
  4828.       VII.1 FILEKEY
  4829.  
  4830.             A separate program called FILEKEY is included which lets you
  4831.       read an entire file into STACKEY's buffer.  STACKEY must be loaded
  4832.       in memory before FILEKEY is invoked or else you will get an error
  4833.       message.   The syntax is
  4834.             filekey <filename>
  4835.       where filename can include a drive and/or path.
  4836.  
  4837.             The file read by FILEKEY should be a standard ASCII file.
  4838.       FILEKEY reads the file into the stack as literal keystrokes with
  4839.       each CR/LF pair (line ending) replaced by a CR.  A final CR is
  4840.       automatically included (but see below).  Thus the two line ASCII
  4841.       file (NOTE: FILEKEY does not ignore leading blanks; for
  4842.       typographical reasons we indent the examples but we describe what
  4843.       would happen if the file lines began in column 1):
  4844.             Now is the time
  4845.             for all good men
  4846.       would be read by FILEKEY as if the command
  4847.             stackey "Now is the time"CR"for all good men"CR
  4848.       were entered at the DOS command line.
  4849.  
  4850.             $ plays the role of a special escape character in the
  4851.       processing by FILEKEY.  If the $ is followed by any character, but
  4852.       ; or another $, then the $ gets passed through in the usual way.
  4853.  
  4854.             "$;" tells FILEKEY to ignore the remainder of the line and
  4855.       not place a CR at the end of that line.  Thus, to avoid having a CR
  4856.       stacked at the end of the final line end the file with $;.  For
  4857.       example, the following file would be equivalent to the last STACKEY
  4858.       example:
  4859.             Now is the $;
  4860.             time
  4861.             $;this is a comment
  4862.             for all $; this is another comment
  4863.             good men
  4864.  
  4865.             $$ tells FILEKEY to toggle to a mode where it reads the
  4866.       file as if it were STACKEY reading a command line with five
  4867.       exceptions:
  4868.             $$ is no longer interpreted as a single $
  4869.             lines are automatically wrapped; i.e. a literal CR/LF (but
  4870.  
  4871.  
  4872.     Chapter VII:ASSOCIATED PROGRAMS                            Page 90
  4873.  
  4874.  
  4875.  
  4876.  
  4877.                   Documentation for STACKEY, Version 3.0
  4878.  
  4879.  
  4880.                not the letter CR or LF) is ignored.
  4881.             utilities mode cannot be called from a file
  4882.             /../ commands cannot be issued
  4883.             permanent palette changes cannot be made $$ will toggle back
  4884.       to the default mode.  Thus the following file is also equivalent to
  4885.       the last STACKEY example:
  4886.             Now is the time$$CR$$for all good men$$CR$$$;
  4887.       The final $$$; is unnecessary.
  4888.  
  4889.             If you want to imbed $$ in the stack from a file, use
  4890.             $$"$$"$$
  4891.       and similarly for $;.
  4892.  
  4893.             Note that [] color changes are allowed in FILEKEY's $$-mode
  4894.       but not permanent palette changes.  This is because the permanent
  4895.       palette changes are utilities.  SC, SS, SH, EX, and IL are all
  4896.       allowed commands after toggling with $$.  Hotkey changes are also
  4897.       allowed in $$-mode.
  4898.  
  4899.             If you use FILEKEY for large scripts you may find that
  4900.       STACKEY's limitation of 10,000 keystrokes in the buffer is
  4901.       insufficient (it surprised us when we got requests for a large
  4902.       buffer but we did from several sources!).  Note that with SKRES,
  4903.       you can load STACKEY with a buffer size of 30,000 bytes, see
  4904.       Section III.12.  Filkey itself is limited to reading in files of no
  4905.       more than 54,000 bytes.
  4906.  
  4907.  
  4908.       VII.2 EGAPAL and VGAPAL
  4909.  
  4910.             The EGA and VGA allow one to keep permanent palettes and non-
  4911.       standard fonts in tables in RAM.  By default, they are stored in
  4912.       ROM but by moving those tables to RAM, one can set permanent
  4913.       palettes different from the default.  Permanent here does not mean
  4914.       surviving rebooting, only surviving a change of mode.   Included
  4915.       with STACKEY are programs that move these permanent palettes.  You
  4916.       can only use STACKEY's permanent palette setting with the supplied
  4917.       EGAPAL, VGAPAL or with the commercial program ULTRAVISION.
  4918.  
  4919.             EGAPAL replaces the DWORD1 program supplied with STACKEY 2.0.
  4920.       Please use EGAPAL rather than DWORD1.  EGAPAL will refuse to load with
  4921.       a VGA - DWORD1 will load but should not be used.  Instead, use VGAPAL.
  4922.  
  4923.  
  4924.  
  4925.  
  4926.     Chapter VII:ASSOCIATED PROGRAMS                            Page 91
  4927.  
  4928.  
  4929.  
  4930.  
  4931.                   Documentation for STACKEY, Version 3.0
  4932.  
  4933.  
  4934.             If you are not running any other EGA/VGA specific programs
  4935.       that use palettes or fonts, you need just run EGAPAL or VGAPAL in
  4936.       your AUTOEXEC.BAT and forget about it.  You'll then have access to
  4937.       the permanent palette setting.  DO NOT REMOVE EGAPAL FROM MEMORY
  4938.       WITH old versions of MARK/RELEASE WITHOUT FIRST RUNNING "EGAPAL Q"
  4939.       AS DESCRIBED BELOW.  If you ignore this warning and you are using
  4940.       these early versions of MARK/RELEASE, you will crash rather
  4941.       spectacularly although we think that you will not hurt your
  4942.       monitor. The more recent versions of MARK/RELEASE and CTRLALT PLUS'
  4943.       ^@<F9>Y command automatically restore the DWORD1 pointer that
  4944.       EGAPAL/VGAPAL change.
  4945.  
  4946.             The first time that you run EGAPAL, it remains resident
  4947.       taking 1600 bytes of RAM most of it in the tables (1472 bytes)
  4948.       that store the palettes.  VGAPAL takes 224 bytes.  In addition to
  4949.       this memory, memory will be taken for a copy of your current
  4950.       environment (see BATUTIL documentation, Section V.1).
  4951.  
  4952.             If EGAPAL/VGAPAL finds that it is not already in memory but
  4953.       another EGA/VGA is, it will refuse to load.  Load EGAPAL/VGAPAL
  4954.       first and use the Q and R parameters.
  4955.  
  4956.             If EGAPAL/VGAPAL is run with no parameters (or with any
  4957.       parameters other than Q or R) it will look for itself in memory.
  4958.       If it finds itself, it exits with a message: "EGAPAL already
  4959.       loaded".  Otherwise it loads itself as described above.
  4960.  
  4961.             When EGAPAL loads, it saves the EGA/VGA address that were
  4962.       there before it loaded.  Running
  4963.             egapal Q
  4964.       (for Quit) will put these addresses back to what they were before
  4965.       EGAPAL loaded.  Running
  4966.             egapal R
  4967.       (for Restore) will put these addresses back to what they were after
  4968.       you initially ran EGAPAL.  If EGAPAL is run with one of these
  4969.       parameters and EGAPAL does not find itself in memory, it will exit
  4970.       with the message: "EGAPAL not loaded".  When looking for
  4971.       parameters, EGAPAL stops after the first one so it doesn't matter
  4972.       what appears after the first R or Q.  Any number of spaces, tabs or
  4973.       /'s can occur between 'egapal' and the Q or R.
  4974.  
  4975.             There are some programs (Microsoft CODEVIEW is an example)
  4976.       which react badly if the save_ptr region is in RAM.  Assuming that
  4977.       you loaded EGAPAL when save_ptr was pointing towards ROM, you need
  4978.  
  4979.  
  4980.     Chapter VII:ASSOCIATED PROGRAMS                            Page 92
  4981.  
  4982.  
  4983.  
  4984.  
  4985.                   Documentation for STACKEY, Version 3.0
  4986.  
  4987.  
  4988.       only run
  4989.             egapal q
  4990.       before such programs and
  4991.             egapal r
  4992.       afterwards.
  4993.  
  4994.             Do this also to use another program that is EGA/VGA specific
  4995.       and insists that it be loaded first.
  4996.  
  4997.  
  4998.       VII.3 Demonstration BATch files
  4999.  
  5000.             The STACKEY package comes with four demonstration BATch files
  5001.       to illustrate some of STACKEY's features.  You should run them (at
  5002.       least the appropriate ones for your monitor) and then study them to
  5003.       see how they work.
  5004.  
  5005.             SOUNDS.BAT illustrates the BEEP command.  You should also look
  5006.       at BATUTIL's SOund command and soundemo.bat.
  5007.  
  5008.             CGACOLOR.BAT shows you how the L and P commands work on the
  5009.       CGA.  The full illustration of the L command requires the small
  5010.       stand alone program BOXES.COM to be in the default directory.  You
  5011.       should only use it with a color monitor.
  5012.  
  5013.             COLOR.BAT and SEECOLOR.BAT illustrate the temporary palette
  5014.       setting on the EGA.  Both take parameters.  COLOR will cycle
  5015.       through all 64 colors on the EGA.  With no parameter or an improper
  5016.       parameter, it displays a message and then runs the file with a
  5017.       default parameter value of 1.  The correct parameter is a single
  5018.       integer.  If the parameter is n, there is a pause of n/2 seconds
  5019.       between color changes.  If you find the switching time too short
  5020.       with the default try n=3 or 4.
  5021.  
  5022.             SEECOLOR will let you see any color or several colors.  You
  5023.       enter
  5024.             seecolor p1 p2...pn
  5025.       where each parameter is either a number (from 0 to 63) or a subset
  5026.       of RrBbGg and those colors will be displayed in order with a pause
  5027.       for keystroke in between.  If an illegal parameter is entered, the
  5028.       BATch file will abort with an error message.
  5029.  
  5030.             In addition to the basic commands they illustrate, these
  5031.       BATch files show other features of STACKEY.  For example, you
  5032.  
  5033.  
  5034.     Chapter VII:ASSOCIATED PROGRAMS                            Page 93
  5035.  
  5036.  
  5037.  
  5038.  
  5039.                   Documentation for STACKEY, Version 3.0
  5040.  
  5041.  
  5042.       should study how COLOR.BAT and SEECOLOR.BAT use redirection to nul
  5043.       and errorlevel to recover from command line errors.  And all the
  5044.       files except SEECOLOR make use of the wait command to control the
  5045.       timing of the BATch file.  The possibility of doing arithmetic on
  5046.       STACKEY's input parameters, discussed in the usage notes, is
  5047.       illustrated in COLOR.BAT.
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.  
  5059.  
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.     Chapter VII:ASSOCIATED PROGRAMS                            Page 94
  5089.  
  5090.  
  5091.  
  5092.  
  5093.                              Chapter VIII:MISCELLANY
  5094.  
  5095.  
  5096.       VIII.1 Usage notes
  5097.  
  5098.             STACKEY checks its numeric input and normally gives an error
  5099.       message Number out of range  if an integer is given over 64K or a
  5100.       number below 256 is required but one larger is given by the user.
  5101.       Colors which are supposed to be in the range 0 to 63 are reduced
  5102.       mod 64 so long as they are less than 256.
  5103.  
  5104.             Any place where STACKEY expects an integer, you can place a
  5105.       product by using a *.  Thus, "W2*35" will be interpreted as "W70".
  5106.       Thus if you want to accept input from a user in a BATch file in
  5107.       seconds rather than clock ticks, you can use "W18*%1".  In addition
  5108.       you can use + and - with multiplications done first.  For example,
  5109.       the timed waits in COLOR.BAT are arranged to run for 64*%1 (the
  5110.       time to show the 64 color changes) minus a fixed amount to take
  5111.       into account the time it takes for the color change commands to
  5112.       load.
  5113.  
  5114.             Note that while DOS normally interprets >,< and | as
  5115.       redirection commands, if enclosed between double quotes, it gets
  5116.       passed as part of the commands line, so these symbols can be
  5117.       stacked by placing them between double quotes (but not between
  5118.       single quotes).  If you prefer, you can use the $g,$l and $q
  5119.       metastrings.
  5120.  
  5121.             You can use stackey to make a batch file that will change the
  5122.       date and time of a file to one you specify.  The following
  5123.       redate.bat file has the syntax:
  5124.             redate <filespec>
  5125.       to change the date and time to the current one and
  5126.             redate <filespec> date time
  5127.       to the specified date and time.  <filespec> can include wildcards:
  5128.             echo off
  5129.             cls
  5130.             if "%2" == "" goto nodate
  5131.             stackey $tCR
  5132.             if "%3" == "" goto notime
  5133.             time %3
  5134.             :notime
  5135.             stackey $M"-"$D"-"$YCR
  5136.             date %2
  5137.             :nodate
  5138.             for %%a in (%1) do copy/b %%a+,,
  5139.             if "%2" == "" goto morenoda
  5140.  
  5141.  
  5142.     Chapter VIII:MISCELLANY                                    Page 95
  5143.  
  5144.  
  5145.  
  5146.  
  5147.                   Documentation for STACKEY, Version 3.0
  5148.  
  5149.  
  5150.             if "%3" == "" goto morenoti
  5151.             time
  5152.             :motenoti
  5153.             date
  5154.             :morenoda
  5155.       The stacked date and time restore the current values (your clock
  5156.       will lose a few seconds).
  5157.  
  5158.             One of the annoyances faced by DOS users is the seeming
  5159.       inability of automatically answering "Y" to "Are you sure (Y/N)?"
  5160.       in a BATch operation where you are issuing a del *.*.  Actually,
  5161.       one can do this with DOS via:
  5162.             echo Y|del *.*
  5163.       and we recommend that, but it may be illuminating to discuss how to
  5164.       do this with STACKEY.   The commands
  5165.             stackey "Y"CR
  5166.             del *.*
  5167.       will not work because DOS flushes the buffer and the characters are
  5168.       lost.  Nor does
  5169.             stackey PH"Y"CR
  5170.             del *.*
  5171.       work because DOS doesn't ask for a keystroke until one is in the
  5172.       buffer.  This illustrates our point that PH only works in limited
  5173.       situations.  But
  5174.             stackey WR"Y"CR
  5175.             del *.*
  5176.       does work.  And
  5177.             stackey W18"Y"CR
  5178.             del *.*
  5179.       works properly and you can probably decrease the 18 to 7 or 8.  A
  5180.       more sophisticated method that works is
  5181.             stackey /up/"YY"CR
  5182.             del *.*
  5183.             stackey /o/
  5184.       After the flags are pUshed for later pOpping, patient mode is
  5185.       turned on.  The first Y which could be anything is flushed by DOS
  5186.       but then the second one is entered.
  5187.  
  5188.             If you have gone to command mode in a FILEKEY file and
  5189.       include a ";", the entire rest of the file will be ignored.  This
  5190.       is consistent with the STACKEY usage.  To add remarks, use $$$; and
  5191.       then remember to begin the next line with a $$ if you wish to
  5192.       remain in command mode.  Processing also halts if FILEKEY
  5193.       comes across an ASCII 0 (NOT the number 0) in your file.
  5194.  
  5195.  
  5196.     Chapter VIII:MISCELLANY                                    Page 96
  5197.  
  5198.  
  5199.  
  5200.  
  5201.                   Documentation for STACKEY, Version 3.0
  5202.  
  5203.  
  5204.             We recommend that you include STACKEY with the default buffer
  5205.       size in your AUTOEXEC.BAT file.  If you later need a large buffer
  5206.       size, you can load a new copy with the /Rxxxx/ command.  Ideally
  5207.       you should use a program like Mark/Release to remove this second
  5208.       copy when finished in which case STACKEY will revert to using the
  5209.       original copy.
  5210.  
  5211.             You might want to also consider issuing some permanent
  5212.       palette change commands in your AUTOEXEC.BAT immediately after
  5213.       loading EGAPAL or VGAPAL.
  5214.  
  5215.             Do NOT use the version of FILEKEY distributed with STACKEY
  5216.       version 1.0 or 2.0 with this version of STACKEY.
  5217.  
  5218.             STACKEY finds itself in memory using the API and not the
  5219.       actual name so you can rename it to any convenient name you wish
  5220.       such as sk.com so long as the extension remains com.
  5221.  
  5222.             STACKEY's help uses a built in version of the CTRLALT
  5223.       Associates' MAKEDOC program currently under development.  This is a
  5224.       shareware program that will let you make resident or non-resident
  5225.       executable display files.  You can remove STACKEY.HLP if you are
  5226.       short for space.  When you ask STACKEY for help, it looks in the
  5227.       current directory and then throughout the path to find STACKEY.HLP
  5228.       and if it is not found, STACKEY will display an error message.
  5229.  
  5230.  
  5231.       VIII.2 Also by the same authors
  5232.  
  5233.             STACKEY was developed by Barry Simon and Richard M. Wilson.
  5234.       Simon and Wilson have formed CTRLALT Associates to market their
  5235.       software.  They are committed to the idea of shareware and both are
  5236.       founding members of the Association of Shareware Professionals.  At
  5237.       the time of this release of STACKEY, CTRLALT Associates has two
  5238.       free programs and several other program under development:
  5239.  
  5240.             CTRLALT PLUS is our flagship product extending the popular
  5241.       free program CTRLALT.  CTRLALT PLUS is expected to be released in
  5242.       1990.  It is a set of resident utilities including extensive cut
  5243.       and paste, a calendar, programmer's utilities (resident tables,
  5244.       emergency exit), two monitor support, a resident file viewer,
  5245.       dialer, calculator, color control and resident printer control.
  5246.  
  5247.  
  5248.  
  5249.  
  5250.     Chapter VIII:MISCELLANY                                    Page 97
  5251.  
  5252.  
  5253.  
  5254.  
  5255.                   Documentation for STACKEY, Version 3.0
  5256.  
  5257.  
  5258.             CTRLALT PLUS and STACKEY/BATUTIL are shareware and can be
  5259.       registered with Support Group, Inc. (see Section I.3).
  5260.  
  5261.             BIGECHO is a simple program which allows a BATch file to
  5262.       display characters which are 8 rows by 8 columns.  Version 1.0 was
  5263.       released in September, 1986.  It is available on many BBS systems
  5264.       and from some disk vendors.  Most of its features are subsumed in
  5265.       BATUTIL.
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.     Chapter VIII:MISCELLANY                                    Page 98
  5305.  
  5306.  
  5307.  
  5308.  
  5309.                   Documentation for STACKEY, Version 3.0
  5310.  
  5311.  
  5312.       Appendix to Chapter VIII
  5313.  
  5314.       Here is a quick summary of the STACKEY command line syntax:
  5315.  
  5316.             - ? will give help
  5317.             - _ will send the remainder of the line to standard output
  5318.             - Place text inside single or double quotes
  5319.             - F1-F0,F-,F=; S1-S0,S-,S=; A1-A0,A-,A=; C1-C0,C-,C= for
  5320.                  function keys
  5321.             - @x or (x for Alt-x where x=letter or number
  5322.             - ^x or ~x for Ctrl-x where x=letter or number
  5323.               (NOTE: @number for top row numbers; ^number for keypad)
  5324.             - LA,RA,UA,DA for arrow keys
  5325.             - PU,PD,HM,EN for Page Up/Dn, Home, End
  5326.             - IN,DE for Insert/Delete
  5327.             - N0,...,N9,N. for numeric keypad numbers and decimal point
  5328.             - G+,G-,G* or N+,N-,N* for Grey keys
  5329.             - PS for PrtSc
  5330.             - CP for Ctrl-PrtSc, CB for Ctrl-Backspace
  5331.             - TA or TB for Tab; ST or BT for Shift Tab
  5332.             - ES,BS,SP,CR for Escape, Backspace, Space, Enter
  5333.             - FF, LF for form feed (^L) and Ctrl-Enter
  5334.             - DQ,SQ for " and '
  5335.             - PH and WR for two kinds of "phony keystroke"
  5336.             - +/-N,+/-S,+/-C,+/-I to turn On/Off Num, Scroll, Caps Lock, Insert
  5337.             - SH(X,nnn) with X a subset of CALR simulates shifts for nnn ticks
  5338.             - CA invokes CTRLALT PLUS
  5339.             - Qn switches to Carousel partition n
  5340.             - Dn with n=1 or 2 invokes Desqview main menu
  5341.             - TE(idstring,keyid) for Tesseract programs
  5342.             - Z+/- clone speedup/slowdown
  5343.             - P-/+ to disable, reenable Shift-PrtScrn
  5344.             - BE for BIOS beeps
  5345.             - MP(msg), ME(msg) for popup messages
  5346.             - $x or *x for prompt metastrings with SEND extensions (see
  5347.                                       below)
  5348.             - \nnn with nnn=decimal number for Alt-keypad entry
  5349.             - Xhhhh with hhhh=hex word for direct hex entry
  5350.             - #nnn or )nnn to repeat the next keystroke nnn times
  5351.             - Wnnn to insert a delay of nnn ticks (18.2 ticks = 1 sec)
  5352.             - Mnnn to insert a delay of nnn minutes
  5353.             - SC(string) to scan at cursor position
  5354.             - SCn,m(string) to scan at absolute position
  5355.             - SS(string) and SSn,m(string) to scan silently
  5356.  
  5357.  
  5358.     Chapter VIII:MISCELLANY                                    Page 99
  5359.  
  5360.  
  5361.  
  5362.  
  5363.                   Documentation for STACKEY, Version 3.0
  5364.  
  5365.  
  5366.             - WB pause script until buffer is empty
  5367.             - WH pause script for restart hotkey
  5368.             - WK pause script for any key
  5369.             Convention: X=subset of CALR; Y=single keystroke like "a" or F1
  5370.             - WS(X,Y) pause for specific key
  5371.             - H!(X,Y) resets flush buffer hotkey (default=AL,!)
  5372.             - H*(X,Y) resets flush scan hotkey (default=AL,G*)
  5373.             - H-(X,Y) resets stop hotkey (default=AL,G-)
  5374.             - H+(X,Y) resets restart hotkey (default=AL,G+)
  5375.             - CL,NL,SL,SR CapsL, NumL, ScrollL, SysReq for hotkey only
  5376.             - ! to flush buffer
  5377.             - ; to stop reading command line (for comments)
  5378.             - /Bnnnn/ to change buffer size on initial loading
  5379.             - /Rnnnn/ to force extra loading with new buffer size
  5380.             - /i/ /s/ and /p/ for impatient, patient, smart processing
  5381.             - /t/ and /n/ to turn test mode on and off
  5382.             - /c/ and /d/ to turn continue mode on and off
  5383.             - /u/ and /o/ to push and pop the s,t,c flags
  5384.             - /?/ to query the s,t,c flags
  5385.             - Ln to set coLors on the CGA (n=0,...,15)
  5386.             - Pn to set palette on the CGA in mode 4 (n=0,1)
  5387.             - [c=nn] to map color number nn to slot c on the EGA
  5388.             - [#m;c=nn] to do the map in the permanent table for mode m
  5389.                     #A:All palettes
  5390.                     #T:Ultravision, text modes only
  5391.                     #U:Ultravision
  5392.             - +/-B to turn blinking on/off on the EGA or VGA
  5393.             - IL(xx/xx/xx/xx)  InLine command (USE WITH CAUTION!)
  5394.             - EX(filename)  External inline (USE WITH CAUTION!)
  5395.  
  5396.       In summarizing utilities mode, minimal truncations are capitalized.
  5397.       Only use the leading capitol letter for x.
  5398.             - {BOOT} or {REBOOT} for a warm reboot
  5399.             - {BOOT=C} or {REBOOT=C} for a cold reboot
  5400.             - {MONitor=x} x=Color,Mono,Switch
  5401.             - {Prn} to switch LPT1 and LPT2
  5402.             - {COmm} to switch COM1 and COM2
  5403.             - {CUrsor=x} x=+/- to turn standard cursor on/off
  5404.             - {CUrsor=n,m} to put cursor on scan lines n through m
  5405.             - {CPosition=n,m} to move the cursor to row n, column m
  5406.             - {MODe=n} switch to allowed video mode
  5407.             - {LInes=n} n=25,43(50) to shift modes on the EGA (VGA)
  5408.             - {LO=xy} where x is + or - and y=N,S,C or I to toggle lock keys
  5409.             - {Wait=nnn} Real time pause of nnn clock ticks; n between 1 and 32K
  5410.  
  5411.  
  5412.     Chapter VIII:MISCELLANY                                   Page 100
  5413.  
  5414.  
  5415.  
  5416.  
  5417.                   Documentation for STACKEY, Version 3.0
  5418.  
  5419.  
  5420.             - {Until=HH:MM} Real time pause until time HH:MM
  5421.             - {DUMPP} to do a screen dump to printer
  5422.             - {DUMPF=x}, {DUMPL=x} to append screen to file with filespec "x"
  5423.             - {DUMPOF=x}, {DUMPOL=x} to overwrite screen to file
  5424.             - {HALT} stops batch file with ^C
  5425.             - {Keywait}, {Enterwait} pause for input
  5426.             - {Abortwait}, {~abortwait} pause for input to abort
  5427.             - {BEep=nn,mm} nn = inverse pitch, mm = duration
  5428.  
  5429.       PROMPT metastrings and extensions:
  5430.             - $v = DOS version            - $t = time in HH:MM:SS.hh format
  5431.             - $n = current drive          - $T = time in HHMM format
  5432.             - $p = current path           - $H = hour from 0 to 23
  5433.             - $P = current path with \    - $d = date in DAY MM-DD-YYYY
  5434.             - $$ = the character $        - $M = month in MM format
  5435.             - $g = the character >        - $D = day in DD format
  5436.             - $l = the character <        - $Y = year in YY format
  5437.             - $q = the character =        - $W = day of the week
  5438.             - $h = the character bks      - $E = date in English
  5439.             - $b = the character |
  5440.             - $e = the character esc
  5441.             - $_ = CR/LF
  5442.  
  5443.       FILEKEY has the following conventions:
  5444.             -  default interprets as pure text
  5445.             -  $$ toggles between pure text and STACKEY command mode
  5446.             -  $; in text mode suppresses CR and remainder of line
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.     Chapter VIII:MISCELLANY                                   Page 101
  5467.  
  5468.  
  5469.  
  5470.    INDEX
  5471.  
  5472.    abortwait              73          errorlevel             71
  5473.    Alt key combinations   18          extended ASCII code 22,78
  5474.    Alt keypad             22          external code          85
  5475.    API                    88          file screen            70
  5476.    arithmetic             95          filekey                90
  5477.    beeps                  70          filekey command mode   90
  5478.    BIOS buffer            76          flush buffer           41
  5479.    BIOS data area         76          flush scan             41
  5480.    blinking bit           60          flushing the buffer    45
  5481.    border colors          51          forty three lines      69
  5482.    boxes.com              93          Function keys          18
  5483.    Break status           48          halt                   72
  5484.    buffer overflow        15          help                   15
  5485.    buffer size            49          hotkeys                41
  5486.    Buffer, enlarging the  46          inline code            84
  5487.    buffer, flushing       45          interupts              74
  5488.    buffer, keyboard       76          keyboard buffer        76
  5489.    buffer, STACKEY's      43          keywait                73
  5490.    Caps Lock              21          L command              52
  5491.    CAROUSEL               24          large buffer           47
  5492.    cgacolor.bat           93          loading STACKEY        13
  5493.    CLONE SPEEDUP          24          lock toggles           72
  5494.    cold reboot            71          loops                  36
  5495.    color codes - CGA      51          messages               26
  5496.    color codes, EGA       55          mode changes           68
  5497.    color.bat              93          modes, graphics        50
  5498.    colors on the CGA      52          music                  70
  5499.    colors on the EGA/VGA  57          normal mode            48
  5500.    com port swap          67          NUL, redirection to    15
  5501.    comments               46          Num Lock               21
  5502.    continue mode          48          Numeric keypad         18
  5503.    Control key                        overscan byte          56
  5504.        combinations       18          P command              53
  5505.    copyright               9          palettes, CGA          53
  5506.    Ctrl-Break             19          palettes, permanent
  5507.    CTRLALT PLUS           23                on the EGA/VGA   59
  5508.    cursor control         69          palettes, temporary
  5509.    Cursor keys            19                on the EGA/VGA   57
  5510.    date                   22          path, current          22
  5511.    delays                 37          pause script           41
  5512.    DESQVIEW               24          permanent palettes
  5513.    directory, current     22                on the EGA/VGA   59
  5514.    disabling print screen 68          permission to copy      8
  5515.    disclaimer              9          phony keystroke        40
  5516.    discontinue mode       49          pop STACKEY flags      49
  5517.    dumpf                  15          popup messages         26
  5518.    dword1                 91          PRIMETIME              25
  5519.    EGA/VGA colors         57          print screen        68,70
  5520.    EGAPAL                 91          printer swap           67
  5521.    enhanced keyboard      20          push STACKEY flags     49
  5522.    enterwait              73          query STACKEY flags    49
  5523.    errorlevel             15          reboot                 71
  5524.  
  5525.  
  5526.  
  5527.    repeats                36
  5528.    resume script          41
  5529.    RrBbGg color labels    54
  5530.    scan                   39
  5531.    scan silently          39
  5532.    screen dumps           70
  5533.    Scroll Lock            21
  5534.    second ASCII code      78
  5535.    seecolor.bat           93
  5536.    SIDEKICK               25
  5537.    SIDEKICK PLUS          25
  5538.    SKRES                  47
  5539.    smart processing       43
  5540.    sounds.bat             93
  5541.    STACKEY's API          88
  5542.    swap ports             67
  5543.    temporary palettes
  5544.          on the EGA/VGA   57
  5545.    TESSERACT              24
  5546.    test mode              48
  5547.    text mode              50
  5548.    time                   22
  5549.    Two key special codes  19
  5550.    ultravision            58
  5551.    Upper ASCII codes      22
  5552.    utilities mode syntax  63
  5553.    VGAPAL                 91
  5554.    W command              64
  5555.    wait for buffer        38
  5556.    wait for hotkey        42
  5557.    wait for key           42
  5558.    wait for request       40
  5559.    waits                  38
  5560.    waits                  64
  5561.    warm reboot            71
  5562.  
  5563.